MathCastle
OlympiadSuperchallengeOlympiad Number Theory

Olympiad Number Theory · Superchallenge problem

By the rearrangement inequality, the maximum of a1b1+a2b2+a3b3+a4b4a_1b_1 + a_2b_2 + a_3b_3 + a_4b_4 over all orderings of {ai}={1,2,3,4}\{a_i\} = \{1, 2, 3, 4\} and {bi}={2,3,5,7}\{b_i\} = \{2, 3, 5, 7\} is achieved by pairing them in the same order, and the minimum by opposite orders. Compute the maximum minus the minimum.