Solution (source code)

= Solution

Use the convention $0\log_20=0$. On the positive support of $p$, the given logarithm inequality gives
$$
D(p,q)=-\sum_{p_r>0}p_r\log_2(q_r/p_r)\ge c\sum_{p_r>0}(p_r-q_r)\ge0.
$$
The logarithm is strictly concave, so its supporting line at one has equality only there. More explicitly, the given global bound forces $c=1/\log_e2$ by differentiation at one, and $x-1-\log_ex$ vanishes only at one. Equality above therefore requires $p_r=q_r$ on the positive support, and no mass of $q$ outside it. Thus \b[equality holds exactly when $p=q$].

For the uniform distribution $q_r=1/n$, the divergence is $D(p,q)=\log_2n-H(p)$. Its nonnegativity gives $\boxed{H(p)\le\log_2n}$, with equality precisely for the uniform law.