- You have to make an array of n elements where the summation of any SUBARRAY won't be divisible by m (n > m). Is it possible? If not then proof?
- You have to make an array of n elements where the summation of any SUBSET won't be divisible by m (n > m). Is it possible? If not then proof? for simplicity: 1 <= n, m <= 100000
Auto comment: topic has been updated by void.abyss (previous revision, new revision, compare).
It is impossible. Consider remainders of the prefix sums of the array. There are at least two that are same, since m < n.
So basically 2 is also not possible?
Yes
http://matcomgrader.com/problem/5777/regalos/
Here is the problem in Spanish. If you are too lazy to translate it notice that in the first line you are given $$$n$$$ and $$$m$$$. You should find index of the values such that their sum is divisible by $$$m+1$$$