Comments

let x > y, and let d be a divisor of x-y, then x-y = qd, we just need to prove that for any array, we can partition it into equal parts each of which has a total sum of d, for any array, we prove the existance of a prefix where the sum is d (because then we would have x'<=x and y'<=y remaining elements, in which x' — y' = (q-1)d, and thus we could repeat the process again), if the start element is equal to d, we are done, otherwise, keep adding elements to the prefix, at each point we are either increasing by 1 or decreasing by 1, thus there must exist a prefix of value = 1, 2, ..., d, for if a prefix of said value didnt exist, that would contradict that the sum of the whole array (which is a prefix) = qd >= d.

B is really good, i have known from the start the the monotone sequence must be the correct answer, but could'nt prove it quickly enough, i guess sometimes you gotta do it based on intuition