Robot and paths

Question link:https://www.codechef.com/problems/CD1IT4
Answer:https://ide.codingblocks.com/s/48141
My code is giving correct answer but at codechef, it is showing wrong anser .
Please help.

Hey @Vidushi04
Your logic is right but you missed out something.
It took me very long to debug your code. You have done a small mistake.
You have to use the property

(a + b) % c = ( a%c + b%c ) % c

Your code gives wrong output for a test case like
155 166 1
3 3

Your answer: 1133393572
But the correct answer is: 133393565

I’ve made changes in your code and also commented out your mistake.
https://ide.codingblocks.com/s/48208

I hope it helps. :relaxed:

thank you so much sir