I will be participating in the upcoming SWERC, so I was revisiting old problems. I don't quite understand how the official solution for Problem H is valid for every possible testcase. It's a classical knapsack, but the constraints are way too high for it to fit in memory, so the official solution does the gcd of the weights, to reduce it by that number. My question is, wouldn't a testcase where gcd = 1 break that? Am I missing something from the statement? Thank you.
The Problem Name its SHARES. It was features in SWERC 2012-2013, Valencia, and also in the regional classification for SWERC, in Valencia, which I also dont understand why that would happen, as it is unfair to repeat problems in such an easy way.
I've included the pdf with the problem statement.




