

Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 100 点
問題文
H 行 W 列の マス目があり、最初すべてのマスは白色です。
あなたは、このマス目に何回かペイント操作を施すことにしました。 1 回のペイント操作では、以下の 2 種類の作業のうちいずれか 1 つが行えます。
- 行をひとつ選び、その行に含まれるマスをすべて黒く塗る。
- 列をひとつ選び、その列に含まれるマスをすべて黒く塗る。
黒く塗られているマスの個数が N 個以上となるようにするためには、最小で何回のペイント操作が必要ですか。 なお、制約の項で記述される条件のもとで、何回かペイント操作を行うことで 黒く塗られているマスの個数が N 個以上となるようにできることが保証されます。
制約
- 1 \leq H \leq 100
- 1 \leq W \leq 100
- 1 \leq N \leq H \times W
- 入力値はすべて整数である。
入力
入力は以下の形式で標準入力から与えられる。
H W N
出力
ペイント操作の回数の最小値を出力せよ。
入力例 1
3 7 10
出力例 1
2
「行をひとつ選び、その行に含まれるマスをすべて黒く塗る」という操作を異なる行に対して 1 回ずつ、 合計 2 回行うことで、黒く塗られているマスの個数を 14 にできます。
入力例 2
14 12 112
出力例 2
8
入力例 3
2 100 200
出力例 3
2
Score : 100 points
Problem Statement
We have a grid with H rows and W columns, where all the squares are initially white.
You will perform some number of painting operations on the grid. In one operation, you can do one of the following two actions:
- Choose one row, then paint all the squares in that row black.
- Choose one column, then paint all the squares in that column black.
At least how many operations do you need in order to have N or more black squares in the grid? It is guaranteed that, under the conditions in Constraints, having N or more black squares is always possible by performing some number of operations.
Constraints
- 1 \leq H \leq 100
- 1 \leq W \leq 100
- 1 \leq N \leq H \times W
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
H W N
Output
Print the minimum number of operations needed.
Sample Input 1
3 7 10
Sample Output 1
2
You can have 14 black squares in the grid by performing the "row" operation twice, on different rows.
Sample Input 2
14 12 112
Sample Output 2
8
Sample Input 3
2 100 200
Sample Output 3
2