Problem:
Score : 100 points

Problem Statement

It has been decided that a programming contest sponsored by company A will be held, so we will post the notice on a bulletin board.

The bulletin board is in the form of a grid with N rows and N columns, and the notice will occupy a rectangular region with H rows and W columns.

How many ways are there to choose where to put the notice so that it completely covers exactly HW squares?

Constraints

1 \leq H, W \leq N \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
H
W

Output

Print the answer.

Sample Input 1

3
2
3

Sample Output 1

2

There are two ways to put the notice, as follows:

### ...
### ###
... ###

Here, # represents a square covered by the notice, and . represents a square not covered.

Sample Input 2

100
1
1

Sample Output 2

10000

Sample Input 3

5
4
2

Sample Output 3

8

Solution in C# (Mono 4.6.2.0) (judge verdict: Runtime Error)

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

class Program {
    static void Main(string[] args) {
        //入力
        string s = Console.ReadLine();
        string[] t = s.Split(' ');
        int N = int.Parse(t[0]);
        int Q = int.Parse(t[1]);

        string a = Console.ReadLine();
        List<int> list_A = new List<int>();
        List<int> list_B = new List<int>();
        int[] X = new int[Q];
        for (int i = 0; i < N; i++) {
            list_A.Add(int.Parse(a.Split(' ')[i]));
            //list_B.Add(int.Parse(a.Split(' ')[i]));
        }

        for (int i = 0; i < Q; i++) {
            X[i] = int.Parse(Console.ReadLine());
        }

        //解答となる数字
        int[] ans = new int[Q];
        for (int i = 0; i< Q; i++) {
            ans[i] = 0;
        }

        //出力
        //X[0] ~ X[Q - 1]まで各行すべて調べていく。
        for (int i = 0; i < Q; i++) {
            //リストBにリストAの内容をコピーする
            for (int bayashiko = 0; bayashiko < N; bayashiko++) {
                list_B.Add(list_A[bayashiko]);
            }


            //ターン数をカウントするための数字
            int turn = 1;

            //最後の数がなくなるまで繰り返す
            while (list_B.Count() >= 1) {
                //高橋のターン
                if (turn % 2 == 1) {
                    //解答に、最大の数を加える
                    ans[i] += list_B[list_B.Count() - 1];
                    list_B.Remove(list_B[list_B.Count() - 1]);

                    turn++;
                //青木のターン
                } else {
                    //各数字との差を取っていく
                    int diff = list_B[list_B.Count() - 1];

                    for (int kari = 0; kari < list_B.Count(); kari++) {
                        diff = Math.Min(diff, Math.Abs(X[kari] - list_B[kari]));
                    }

                    for (int kari = 0; kari < list_B.Count(); kari++) {
                        if (diff == Math.Abs(X[i] - list_B[kari])) {
                            //リストからリムーブする
                            list_B.Remove(list_B[kari]);
                        }
                    }

                    turn++;
                }
            }
        }

        //出力
        for (int i = 0; i < Q; i++) {
            Console.WriteLine(ans[i]);
        }
    }
}