Solve UVa 567 - Risk.