For this Question: Given a rectangular tile of dimensions N*M, you have to divide the tile into three rectangular pieces such that the three pieces can be combined (without breaking any piece) to form the original tile. Let the area of the three pieces be a, b and c. You have to find the minimum value of (max(a, b, c) - min(a, b, c)).First Line of input contains two integers N and M.

Constraints 
 
1 <= N, M <= 100000Output a single integer which is the minimum possible value of (max(a, b, c) - min(a, b, c)).Sample Input 1 
3 5

Sample Output 1 
0

Explaination : we can break tile into (1*5) (1*5) (1*5)

Sample Input 2 
4 5

Sample Output 2 
2

Explaination : we can break tile into (4*2) (2*3) (2*3), I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) {

		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int m = s.nextInt();

		if((n%3==0)||(m%3==0)) {
			System.out.print(0);
		} else {
			int res[]=new int[3];
			int max = Math.max(n,m);
			int min = Math.min(n,m);
			int lt;
			if(max%3==2) {
				lt=max/3+1;
			} else {
				lt=max/3;
			}

			res[2]=lt*min;
			if((max-lt)%2==0||min%2==0) {
				res[0]=((max-lt)*min)/2;
				res[1]=((max-lt)*min)/2;
			} else {
				int tmax = Math.max(min,(max-lt));
				int tmin = Math.min(min,(max-lt));
				int tt=(tmax/2)+1;
				res[0]=tt*tmin;
				res[1]=(tmax-tt)*tmin;
			}

			Arrays.sort(res);
			System.out.print(res[2]-res[0]);
		}
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?