UVA input format is very frustrating to deal with, or that what I see. For example this UVA 825 problem Anyone can help how to deal with this type of input format and other formats like not giving the number of testcases, the input ends by a newline and other things like those ? :)