Олимпиадный тренинг

Задача 37683. Square


Задача

Темы:
The town square is n x m and covered with 1 x 1 square tiles. it was decided to cover with tiles only the path along the edge of the square, and to break a rectangular flower bed in the center of the square (see the picture for example). In this case, the path must have the same width on all sides of the square. Determine the maximum track width that can be laid out of the available tiles.

Input data format
The first and second lines of the input contain one number n and m each (3 ≤ n ≤ 2 x 10 , 3 ≤ m ≤ 2 x 109) - size of the area.
The third line contains the number of tiles t, 1 ≤ t < nm.
Output data format
The program should output a single number - the maximum track width that
can be laid out from existing tiles.
 
Input Output
6
7
38
2


Remark
Explanation for example. The area has dimensions of 6 x 7, from 38 tiles you can lay out a track with a width of 2 tiles.