For clarity we write p and p+2 for 20200 and 20202 whenever possible. The conditions are a+c=p+2, b+d=p. By symmetry assume b≤d, then 1≤b≤2p. In each sum S=ba+dc replace a and c by their extremal values a=1,c=p+1 and a=p+1,c=1. In view of a+c=p+2 and b≤d comparison with S shows respectively (b1+dp+1)−S=(a−1)(d1−b1)≤0, (bp+1+d1)−S=(c−1)(b1−d1)≥0. Hence minS is attained with
a = 1, c = p+1, and maxS with a=p+1,c=1. Thus maxS is the greatest value of bp+1+p−b1 where 1≤b≤2p. It is straightforward that b=1 yields a maximum. The result is p+1+p−11 which is greater than p+1, while b≥2 implies bp+1+p−b1≤2p+1+1<p+1. In particular maxS=20201+201991 for p=20200, attained at a=20201,b=1,c=1,d=20199.
f(b)−f(b−1)=b(b−1)(p−b)(p−b+1)p(b2+b−p−1)
Because b(b−1)(p−b)(p−b+1)>0 for 2≤b≤2p, the sign of f(b)−f(b−1) coincides with the sign of b2+b−p−1. For p=20200 this leads to the quadratic function b2+b−20201. It has one negative root and one root between 141 and 142. Hence b2+b−20201<0 for 2≤b≤141 and b2+b−20201>0 for b≥142. It follows that f(1)>f(2)>⋯>f(141) and f(141)<f(142)<…, showing that minf is attained at b=141 and equal to 1411+2005920201. This is the minimum of S under the given constraints, attained at a=1,b=141,c=20201,d=20059.