UVA 147 (easy dp)