The test case
1 4 1 2 1 2
is accepted as a valid hack for problem A, but it clearly violates the constraints (It is guaranteed that all the numbers except one in the a array are the same). Could the problemsetters please fix this and rejudge A submissions?
The same for G now. It doesn't check $$$1 \leq c \leq 10^7$$$, so a number like $$$2 \cdot 10^7$$$ is valid and can cause runtime errors galore.
Problem G already exists.Original G. Don't know how the Authors didn't notice it.