Thanks TripleM
well i do understand what you mean by redirecting the output but you mean to say we can use file handling in our programs ! i thought that was not allowed ?
and again is the behavoir of the SPOJ online judge and the ACM UVA judge the same ?
Going back to the problem: can the sample run of the program be like this
1
1
1
2
2
88
88
42
and the program stops after that ?
PS that 42 has been printed.