20131017-03

UVA 119: same as usaco gift 1, kind of tricky on output. and please
remove freopen if you have it in the program.