Need help with AtCoder Beginner Contest 186 Problem E
I tried reading the editorial but cannot understand this problem
The main point which I cannot understand is why should S % gcd(N,K) be equal to 0?
CF Edu Round 173 Solution Discussion