Solve UVa 10154 - Weights and Measures.