#P6784. Maximum Floors Construction
Maximum Floors Construction
Maximum Floors Construction
pigstd has \( a \) units of material A and \( b \) units of material B. To build the \( i \)-th floor, he needs exactly \( i \) units of material A and \( i \) units of material B. In addition, pigstd has \( c \) dollars, and each dollar can be used to buy one unit of either material A or material B.
Find the maximum number of floors that pigstd can build.
inputFormat
The input consists of a single line containing three space-separated integers: \( a \), \( b \), and \( c \).
outputFormat
Output a single integer: the maximum number of floors that can be built.
sample
2 2 0
1