Working fine with test input[Code](https://www.codechef.com/viewsolution/32136987)
This will work only for 1 test case since there is no loop for multiple test cases, moreover I would urge you to take another look at line#20.
thanks i forgot to check input