Hi, I have been trying to solve this problem for a very long time now. But getting WA. Can anyone please check out my code and tell me what's wrong with it?
Problem link: https://icpcarchive.ecs.baylor.edu/external/69/6982.pdf
My code: http://ideone.com/ti6xRi
So after a day I found that the live archive judge has no AC submission. My code got accepted in Codechef though. Here's the Codechef link of the problem: https://www.codechef.com/problems/AMR14C