Language: Java

class Main{
	public static void main(String[] args){
  if (N == M){
  System.out.println(N);
}
	if (N%M == 0){
  		System.out.println(-1);
	}
		else if(M%N == 0){
        	System.out.println(-1);
    	}		
			else if (N > M){
              int t;
				while ((N%M) != 0)
              	{
              		t = N%M;
                  	N = M;
                  	M = t;
                } 
              	System.out.println(N*M/t);
        	}
				else {
                  while ((M%N) != 0)
              		{
              			t = M%N;
                  		M = N;
                  		N = t;
                	} 
              	System.out.println(N*M/t);
                }
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
  if (N == M){
      ^
  symbol:   variable N
  location: class Main
Main.java:3: error: cannot find symbol
  if (N == M){
           ^
  symbol:   variable M
  location: class Main
Main.java:4: error: cannot find symbol
  System.out.println(N);
                     ^
  symbol:   variable N
  location: class Main
Main.java:6: error: cannot find symbol
	if (N%M == 0){
	    ^
  symbol:   variable N
  location: class Main
Main.java:6: error: cannot find symbol
	if (N%M == 0){
	      ^
  symbol:   variable M
  location: class Main
Main.java:9: error: cannot find symbol
		else if(M%N == 0){
		        ^
  symbol:   variable M
  location: class Main
Main.java:9: error: cannot find symbol
		else if(M%N == 0){
		          ^
  symbol:   variable N
  location: class Main
Main.java:12: error: cannot find symbol
			else if (N > M){
			         ^
  symbol:   variable N
  location: class Main
Main.java:12: error: cannot find symbol
			else if (N > M){
			             ^
  symbol:   variable M
  location: class Main
Main.java:14: error: cannot find symbol
				while ((N%M) != 0)
				        ^
  symbol:   variable N
  location: class Main
Main.java:14: error: cannot find symbol
				while ((N%M) != 0)
				          ^
  symbol:   variable M
  location: class Main
Main.java:16: error: cannot find symbol
              		t = N%M;
              		    ^
  symbol:   variable N
  location: class Main
Main.java:16: error: cannot find symbol
              		t = N%M;
              		      ^
  symbol:   variable M
  location: class Main
Main.java:17: error: cannot find symbol
                  	N = M;
                  	^
  symbol:   variable N
  location: class Main
Main.java:17: error: cannot find symbol
                  	N = M;
                  	    ^
  symbol:   variable M
  location: class Main
Main.java:18: error: cannot find symbol
                  	M = t;
                  	^
  symbol:   variable M
  location: class Main
Main.java:20: error: cannot find symbol
              	System.out.println(N*M/t);
              	                   ^
  symbol:   variable N
  location: class Main
Main.java:20: error: cannot find symbol
              	System.out.println(N*M/t);
              	                     ^
  symbol:   variable M
  location: class Main
Main.java:23: error: cannot find symbol
                  while ((M%N) != 0)
                          ^
  symbol:   variable M
  location: class Main
Main.java:23: error: cannot find symbol
                  while ((M%N) != 0)
                            ^
  symbol:   variable N
  location: class Main
Main.java:25: error: cannot find symbol
              			t = M%N;
              			^
  symbol:   variable t
  location: class Main
Main.java:25: error: cannot find symbol
              			t = M%N;
              			    ^
  symbol:   variable M
  location: class Main
Main.java:25: error: cannot find symbol
              			t = M%N;
              			      ^
  symbol:   variable N
  location: class Main
Main.java:26: error: cannot find symbol
                  		M = N;
                  		^
  symbol:   variable M
  location: class Main
Main.java:26: error: cannot find symbol
                  		M = N;
                  		    ^
  symbol:   variable N
  location: class Main
Main.java:27: error: cannot find symbol
                  		N = t;
                  		^
  symbol:   variable N
  location: class Main
Main.java:27: error: cannot find symbol
                  		N = t;
                  		    ^
  symbol:   variable t
  location: class Main
Main.java:29: error: cannot find symbol
              	System.out.println(N*M/t);
              	                   ^
  symbol:   variable N
  location: class Main
Main.java:29: error: cannot find symbol
              	System.out.println(N*M/t);
              	                     ^
  symbol:   variable M
  location: class Main
Main.java:29: error: cannot find symbol
              	System.out.println(N*M/t);
              	                       ^
  symbol:   variable t
  location: class Main
30 errors