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++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
#include <functional>
#include <climits>
#include <iomanip>
#include <utility>
#include <stack>
#include <queue>
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <numeric>
#include <stack>
typedef std::stack<long long> llStack;
typedef std::stack<char> charStack;

using namespace std;
using ll = long long;
typedef pair <int, int> pii;
int main()
{
    ll a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, ans = 0;
    ll n;
    ll memo[1003][1003] = {};
    ll memo2[1003][1003] = {};
    char tmp;
    //ll y[1003][1003] = {};
    //ll y[100005] = {};
    //ll z[100005] = {};
    string s[1003];
    llStack xStack;
    llStack yStack;
    charStack Stack;
    cin >> a;
    cin >> b;
    for (int i = 0; i < a; i++)
    {
        cin >> s[i];
    }
    for (int i = 0; i < a; i++)
    {
        for (int k = 0; k < b; k++)
        {
            if (s[i][k] == '#'&&memo2[i][k]==0)
            {
                memo2[i][k]=1;
                for (int z = 0; z < a; z++)
                {
                    for (int y = 0; y < b; y++)
                    {
                        memo[z][y] = 0;
                    }
                }
                yStack.push(i);
                xStack.push(k);
                Stack.push('#');
                while (xStack.size() > 0)
                {
                    c = yStack.top();
                    yStack.pop();
                    d = xStack.top();
                    xStack.pop();
                    tmp = Stack.top();
                    Stack.pop();
                    memo[c][d] = 1;
                    //cout << c << endl;
                    //cout << d << endl;
                    if (0 <= c+1&&c+1 < a && 0 <= d&&d < b&&memo[c+1][d] == 0 && s[c+1][d] != tmp)
                    {
                        yStack.push(c+1);
                        xStack.push(d);
                        memo[c + 1][d] = 1;
                        memo2[c+1][d] = 1;
                        if (tmp == '#')
                        {
                            Stack.push('.');
                        }
                        else
                        {
                            Stack.push('#');
                        }
                        //cout << yStack.top() << endl;
                        //cout << xStack.top() << endl;
                        //cout << Stack.top() << endl;

                    }
                    if (0 <= c-1&&c-1 < a && 0 <= d&&d < b&&memo[c-1][d] == 0 && s[c-1][d] != tmp)
                    {
                        yStack.push(c-1);
                        xStack.push(d);
                        memo[c - 1][d] = 1;
                        memo2[c-1][d] = 1;
                        if (tmp == '#')
                        {
                            Stack.push('.');
                        }
                        else
                        {
                            Stack.push('#');
                        }

                    }
                    if (0 <= c&&c < a && 0 <= d+1&&d+1 < b&&memo[c][d+1] == 0 && s[c][d+1] != tmp)
                    {
                        yStack.push(c);
                        xStack.push(d+1);
                        memo[c][d + 1] = 1;
                        memo2[c][d+1] = 1;
                        if (tmp == '#')
                        {
                            Stack.push('.');
                        }
                        else
                        {
                            Stack.push('#');
                        }

                    }
                    if (0 <= c&&c < a && 0 <= d-1&&d-1 < b&&memo[c][d-1] == 0 && s[c][d-1] != tmp)
                    {
                        yStack.push(c);
                        xStack.push(d-1);
                        memo[c][d - 1] = 1;
                        memo2[c][d-1] = 1;
                        if (tmp == '#')
                        {
                            Stack.push('.');
                        }
                        else
                        {
                            Stack.push('#');
                        }
                        
                    }
                    
                    //cout << endl;

                }
                e = 0;
                f = 0;
                for (int z = 0; z < a; z++)
                {
                    for (int y = 0; y < b; y++)
                    {
                        if ((i + k) % 2 != (z + y) % 2 && memo[z][y] == 1)
                        {
                            e++;
                        }
                        else if(memo[z][y] == 1)
                        {
                            f++;
                        }
                    }
                }
                ans += e*f;
                //cout << e << endl;
                //cout << f << endl;
                //cout << endl;

            }
        }
    }

    cout << ans << endl;
    //cout << ans << endl;

    ////std::cout << std::fixed;
    //cout << std::setprecision(20) << << endl;
    //cout << d+1 << endl;
    //cout << "" << endl;

    return 0;
}