https://www.codechef.com/viewsolution/32003595
Please help to find out why the two test cases are failing