10. Given x1,x2,⋯,x40 are all positive integers, and x1+x2+⋯+x40=58. If the maximum value of x12+x22+⋯+x402 is A, and the minimum value is B, then the value of A+B is
Official solution
10.494.
Since the number of ways to write 58 as the sum of 40 positive integers is finite, the minimum and maximum values of x12+x22+⋯+x402 exist. Assume without loss of generality that x1⩽x2⩽⋯⩽x40. If x1>1, then x1+x2=(x1−1)+(x2+1), and (x1−1)2+(x2+1)2=x12+x22+2(x2−x1)+2>x12+x22.
Therefore, when x1>1, x1 can be gradually adjusted to 1, at which point x12+x22+⋯+x402 will increase.
Similarly, x2,x3,⋯,x39 can be gradually adjusted to 1, at which point x12+x22+⋯+x402 will increase.
Thus, when x1,x2,⋯,x39 are all 1 and x40=19, x12+x22+⋯+x402 reaches its maximum value, i.e., A=39 terms 12+12+⋯+12+192=400.
If there exist two numbers xi and xj such that xj−xi⩾2(1⩽i<j⩽40), then (xi+1)2+(xj−1)2=xi2+xj2−2(xj−xi−1)<xi2+xj2.
This indicates that in x1,x2,⋯,x39,x40, if the difference between any two numbers is greater than 1, then by increasing the smaller number by 1 and decreasing the larger number by 1, x12+x22+⋯+x402 will decrease.
Therefore, when x12+x22+⋯+x402 reaches its minimum value, the difference between any two numbers in x1,x2,⋯,x40 does not exceed 1.
Thus, when x1=x2=⋯=x22=1 and x23=x24=⋯=x40=2, x12+x22+⋯+x402 reaches its minimum value, i.e., B=22 terms 12+12+⋯+12+18 terms 22+22+⋯+22=94.
Hence, A+B=494.
Source: NuminaMath-1.5,
licensed Apache-2.0.
Statement and solution reproduced as published; topic, difficulty and ordering added
by this site.