Solution (source code)

= Solution
{c}

For any fixed $p>1/4$, the alternative-to-null <likelihood ratio> is
$$
R_p(S)=\left(\frac{1-p}{3/4}\right)^5
\left(\frac{3p}{1-p}\right)^S,
$$
which is strictly increasing in $S$ for $1/4<p<1$. Consequently the <Neyman-Pearson lemma> selects the same upper-tail ordering for every such <alternative hypothesis>. At the <null hypothesis> value,
$$
\mathbb P_{1/4}(S\geq4)
=\binom54\left(\frac14\right)^4\frac34+\left(\frac14\right)^5
=\frac{15+1}{1024}=\frac1{64}.
$$
Therefore
$$
\boxed{\text{reject }H_0\text{ exactly when }S\geq4}
$$
is a <uniformly most powerful test> of the required exact <test size>. Its <power function> is $5p^4(1-p)+p^5=5p^4-4p^5$. At $p=1$ its <statistical power> is one, so including that boundary alternative preserves the conclusion.