Problem Statement: https://www.codechef.com/FFC12019/problems/SHADOW

One quick thing to check should be the case when L > R. They have mentioned it, **in bold**, that it is not necessary that L <= R or vice versa. So, basically what you need to do is, if L>R, swap L and R.

But still, I would say it was ambiguous what to do with it if L > R. Since statement said " values between L to R (inclusive) ", I thought, if L>R, then there are no values from L to R. So, I considered PS=0 and Sum of values divisible by LCM(A,B) also to be 0. But it didnâ€™t work, so I thought, letâ€™s try with swapping L and R, and it worked. All in all, it was not a good problem statement. It could and should have been more clear.

Damn! missed that conditionâ€¦

Got AC now https://www.codechef.com/viewsolution/24889225

BTW Thanks!

No problem.

So, one suggestion is, to always **RE-READ** a question in case you get a WA verdict and you think â€śThis question is too easy, I donâ€™t think I am wrongâ€ť, which can happen a lot in easy questions. Especially if they are intentionally made with weird corner cases. And, also try to see if you have used every information they have provided. Although, it is still based on intuition. Sometimes they might give extra useless information, which you have to discard/neglect.

Anyway, Congratulations on solving it. Cheers!

I think the statement was ambiguous. I wanted to make clear that if L>R then people should swap their values. Like if L=10 and R=20 then it also possible that L=20 and R=10, so in such case swap the values. Sorry guys for the inconvenience caused.

Here is the **editoria**l for SHADOW: SHADOW - EDITORIAL