This is my code https://ide.codingblocks.com/s/351372 for the Recursive Sequence 2 from Spoj: https://www.spoj.com/problems/SPP/ or CB: https://online.codingblocks.com/app/player/115281/content/73626/5125/code-challenge.
My code successfully passed all testcases in CB platform but when i submit in SPOJ the code failed. Additionally i cross checked with one of the debug testcases given by one of the fellow problem solver. The first and last answer in the debug case differed. Can you help me to debug this. I think the problem may be with modulus operation as my code works fine for smaller or certain cases only for certain other cases it outputs a different answer.