USAMO
2017
Let m1,m2,…,mn be a collection of n positive integers, not necessarily distinct. For any sequence of integers A=(a1,…,an) and any permutation w=w1,…,wn of m1,…,mn, define an A-inversion of w to be a pair of entries wi,wj with i<j for which one of the following conditions holds: ai≥wi>wj wj>ai≥wi, or wi>wj>ai. Show that, for any two sequences of integers A=(a1,…,an) and B=(b1,…,bn), and for any positive integer k, the number of permutations of m1,…,mn having exactly k A-inversions is equal to the number of permutations of m1,…,mn having exactly k B-inversions.