Can anybody help me out, point me to a test case (counter example) for my algorithm, or any ideas. Thanks guys, heres my current code,
UPDATE-I literally have no idea why im getting WA now as I am pretty sure about my solution. Any help would be so good
UPDATE-Beware of possible \n at the end of the input file. I recieved almost a dozen WA because I couldnt understand why my solution wasnt correct until I played around and saw some wierd output when I had \n\n at the end of my input file!! BEWARE