What is wrong with my KFORK code?

So, idk… Tried all possible test cases (I think…) but WA.

my code:
http://pastebin.com/6D6KGp7a

this is a problem:
http://www.codechef.com/LTIME11/problems/KFORK