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: import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
    
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader()
        {
            br = new BufferedReader(
                new InputStreamReader(System.in));
        }
 
        String next()
        {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt() { return Integer.parseInt(next()); }
 
        long nextLong() { return Long.parseLong(next()); }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
 
        String nextLine()
        {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static boolean prime[]= new boolean[10000001];
    public static void  sieve()
    {
        
        for(int i=0;i<=10000000;i++)
            prime[i] = true;
        prime[0] = prime[1] = false;
        for(int p = 2; p*p <=10000000; p++)
        {
            // If prime[p] is not changed, then it is a prime
            if(prime[p] == true)
            {
                // Update all multiples of p
                for(int i = p*p; i <= 10000000; i += p)
                    prime[i] = false;
            }
        }
        
    }
     static ArrayList<Integer> primeFactors(int n)
    {
        ArrayList<Integer> pflist=new ArrayList<>();
        int c = 2;
        while (n > 1) {
            if (n % c == 0) {
                pflist.add(c);
                n /= c;
            }
            else
                c++;
        }
        return pflist;
    }
    
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		FastReader sc = new FastReader();
		BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        
        int cases = sc.nextInt();
        //sieve();
        while(cases-->0)
        {
            int n=sc.nextInt();
            int m=sc.nextInt();
            out.write((2*m*n-m-n)+"\n");
            
            
           
        }
        out.flush();
	}
	public static void reverse(int[] array)
	{
	    int n=array.length;
	    for(int i=0;i<n/2;i++)
	    {
	        int temp=array[i];
	        array[i]=array[n-i-1];
	        array[n-i-1]=temp;
	    }
	}
}
class Pair implements Comparable<Pair> {
    int first,second;
    
    public Pair(int first,int second)
    {
        this.first =first;
        this.second=second;
    }
    public int compareTo(Pair b)
    {
        //first element in descending order
         if (this.first!=b.first)
            return (this.first>b.first)?-1:1;
        else 
            return this.second<b.second?-1:1;
            //second element in incresing order
    }
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?