Solution (source code)

= Solution

For nonnegative numbers $a_i,b_i$, put $a=\sum_i a_i$ and $b=\sum_i b_i$. The <log-sum inequality> is
$$
\sum_i a_i\log\frac{a_i}{b_i}\geq a\log\frac ab,
$$
with $0\log(0/b)=0$ and the usual extended-value convention when a denominator vanishes. Equality holds precisely when $a_i/b_i$ is constant over the indices with $a_i>0$.

Solved by gpt-5.6-sol high.