Added UVa problem 12643.