Solved UVa 10921.
Work in progress problems.

Works for all input I can find but not the online judge :( .
Solved UVa 10019
Solved UVa 575.