Hints: Mickey Mouse Constructive
Answer to Hint 1: The total sum is $S = x - y$. If all parts have the same sum, that common sum is $S/m$, so $m$ must be a divisor of $S$ (in the integer sense when $S \neq 0$). If $S = 0$, the only possible equal positive part sum is $0$, which forces a different discussion.
So any valid partition into $m$ equal-sum parts requires $m \mid S$ when $S \neq 0$.
Answer to Hint 2: For a fixed array $a$, $f(a)$ counts the number of ways to choose cut positions so that every block sum equals $S/m$ for some $m \ge 1$. Equivalently, you choose $m \mid S$ and then count ways to split into $m$ parts each summing to $S/m$.
What familiar arithmetic function lower-bounds how many distinct $m$ can occur for a worst-case array?
Answer to Hint 3: You are minimizing, over arrangements of $x$ pluses and $y$ minuses, the number of valid partitions (not the number of parts). The minimum achievable value turns out to be the number of positive divisors of $|x-y|$ when $x \neq y$, and $1$ when $x = y$.
Try to connect “how many ways to cut into equal-sum blocks” to divisors of the total sum for an optimal arrangement.
Answer to Hint 4: One extremal arrangement is all $1$s first, then all $-1$s (or the reverse, depending on $x$ and $y$). For that shape, prefix sums behave monotonically within each block, which minimizes the number of admissible partitions to $\tau(|x-y|)$ when $x \neq y$.
Here $\tau(d)$ denotes the number of positive divisors of $d$.