Sorry for the weird name of topic.
We have two arrays of non-negative integers A and B. Their length is N
Let's sort these arrays.
A' — a permutation of A.
How to prove that there is no A' such that:
A'[1]*B[1]+..+A'[N]*B[N] > A[1]*B[1]+...+A[N]*B[N]. (A and B are sorted)
I understand that it is a clear fact but I can't prove it.
Sorry for my English. I tried to write correctly:)