Help in KFIB


My code : https://www.codechef.com/viewsolution/35584656

Share your code or submission link

you should give the question link , your solution link with your question. helps other to answer easily.

Refer https://github.com/strikersps/Competitive-Programming/tree/master/Code-Chef/K-Fibonacci for solution.

You may get negative answers. -5\%3 computes as -2, but what you want is 1.

i solved it with a simple calculation using queue
if you want you can refer to my code-https://www.codechef.com/viewsolution/35616238