FLIPCOIN..... right for sample test case but giving wrong answer..

CodeChef: Practical coding for everyone my solution is giving right answer for all sample test cases and the random inputs i have given but still getting wrong answer on submission…which test case am i missing??
kindly help…