For this Question: Ram has recently purchased an empty rectangular grid of NxM dimension. He wants to fill the grid but in a special way. His way of filling is, He choose any block which is not filled yet and fills it and the points obtained in particular step is the number of filled neighbouring block. Neighbour block denotes the block which shares some common side between them. When Ram fills all the blocks then he will stop and calculate the total number of points. Ram wants to know the maximum points he can get?The first line of the input contains a single Integer T, denoting number of test cases.
The next T lines contains two space separated integer N, M i.e dimensions of grid.

<b>Constraints</b>
1 ≤ T ≤ 100
1 ≤ N, M ≤ 1000Print the maximum number of points Ram can get.Sample Input 
1
2 2

Sample Output 
4

Explanation
Ram can obtain total score 4 in the following way.
First he filled top right block, point = 0;
Then he filled bottom left block, point = 0;
Then when he fill either top left and bottom right, the points obtained in both the cases will be 2 hence maximum 4 points are possible., I have written this Solution Code: /**
 *    author:  tourist1256
 *    created: 2022-06-24 16:26:02
 **/

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

template <class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

template <class key, class value, class cmp = std::less<key>>
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;
// find_by_order(k)  returns iterator to kth element starting from 0;
// order_of_key(k) returns count of elements strictly smaller than k;

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 2351
#endif

#define int long long

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

inline int64_t random_long(long long l = LLONG_MIN, long long r = LLONG_MAX) {
    uniform_int_distribution<int64_t> generator(l, r);
    return generator(rng);
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int tt;
    cin >> tt;
    while (tt--) {
        int n, m;
        cin >> n >> m;
        int array[n][m];
        array[0][0] = 1;

        int ans = 0;

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (i > 0 && array[i - 1][j] == 1) {
                    ans++;
                }
                if (j > 0 && array[i][j - 1] == 1) {
                    ans++;
                }
                array[i][j] = 1;
            }
        }

        cout << ans << endl;
    }
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?