My solution to "COINS" on ideone and during my testing is working fine. But I get
time limit exceeded. How to cope with that kind of input, where number
of test cases isn't provided first? Does the program need to close
after time limit or is it enough to provide right output in this time?