Problem:
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

Solution in C# (.NET Core 3.1.201) (judge verdict: Runtime Error)

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;


class Program
{
    static void Main(string[] args)
    {
        // 入力
        //var s = Console.ReadLine();
        var n = long.Parse(Console.ReadLine());
        long[] x = new long[n];
        long[] l = new long[n];
        for (int i = 0; i < n; i++)
        {
            int[] t = Console.ReadLine().Split().Select(int.Parse).ToArray();
            x[i] = t[0];
            l[i] = t[1];
        }

        Array.Sort(x, l);

        var ans = new List<int>();
        for (int i = 0; i < n; i++)
        {
            if (i == n - 1)
            {
                ans.Add(i);
                break;
            }

            if (x[i] - l[i] > x[i + 1] - l[i + 1])
            {
                if (x[i] + l[i] < x[i + 1] - l[i + 1])
                {
                    ans.Add(i);
                }
                else if (x[i] + l[i] > x[i + 1] - l[i + 1])
                {
                    if (x[i] + l[i] < x[i + 1] + l[i + 1])
                    {
                        ans.Add(i);
                        i++;
                    }
                }
                else
                {
                    ans.Add(i);
                }
            }
            else
            {
                if (x[i+1] + l[i+1] < x[i] - l[i])
                {
                    ans.Add(i+1);
                    i++;
                }
                else if (x[i+1] + l[i+1] > x[i] - l[i])
                {
                    if (x[i+1] + l[i+1] < x[i] + l[i])
                    {
                        ans.Add(i+1);
                        i++;
                    }
                }
                else
                {
                    ans.Add(i+1);
                }
            }
        }


        // 出力
        Console.WriteLine(ans.Count());
    }
}