Cake Cutting

No attempts yetTime limit1sMemory limit128 MB

Problem

You are given a rectangular cake with integer dimensions w×hw \times h. Divide the cake into mm rectangular pieces, each with integer dimensions, so that the area of the largest piece is as small as possible. Every cut must be a straight line parallel to one of the sides of the cake, and it must split a single existing piece into two pieces, each of positive area. Because each cut splits exactly one piece into two, dividing the cake into mm pieces requires exactly m1m - 1 cuts.

Input

The input contains several test cases. Each test case is a line with three integers ww, hh, and mm separated by single spaces, where 1w,h,m201 \le w, h, m \le 20 and mwhm \le wh. The line w=h=m=0w = h = m = 0 marks the end of the input and must not be processed.

Output

For each test case, print a single line containing one positive integer: the minimum possible area of the largest piece.

Hint

When w=4w = 4, h=4h = 4, and m=4m = 4, the following cuts minimize the area of the largest piece:

When w=4w = 4, h=4h = 4, and m=3m = 3, the following cuts are optimal: