PLEASE, PLEASE, check correcntess of tests before uploading new problem to SPOJ!
Wery common inconsistence is "\r\n" as a newline characters instead of "\n", some reading methods (for example, gets in C) may store that '\r' symbol at the end of string.
Probably that extra '\r' symbol appears because tests were generated on Windows. So, isn't it possible to generate all the tests on server? Or, at least, make and run some validator to ensure that all the tests are correct?