Need Help! My my code successfully works with many testcases that i can think of.There is no problem with run & compile panel of codechef but when i am submitting my code it says WA. The Question Code is BSTOPS

I am posting my solution link.
I have applied every solution i can think of.
Problem Link -
Please help me.