Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long M = sc.nextLong();
    long[] A = new long[N];
    long num1 = 0;
    long num2 = 0;
    long swap = 0;
    long r = 0;
    for(int i=0; i<N; i++){
    	A[i] =sc.nextLong();
    }
    long max = A[0]; //最小公倍数
    
    //最小公倍数を求める
    for(int i=1; i<N; i++){
      a = max;
      b = A[i];
      x = a * b;
      if (a < b){ swap = a; a = b; b = swap;}
      r = a % b;
      while(r!=0){
    		a = b;
   			b = r;
   			r = a % b;
  	  }
      max = x/b; 
    }
    if( max > M * 2 ) System.out.println(0);
    else{
      int ans = M / max + 1;
      System.out.println(ans);   
    }
  }
}


Compiler output:
Main.java:19: error: cannot find symbol
      a = max;
      ^
  symbol:   variable a
  location: class Main
Main.java:20: error: cannot find symbol
      b = A[i];
      ^
  symbol:   variable b
  location: class Main
Main.java:21: error: cannot find symbol
      x = a * b;
      ^
  symbol:   variable x
  location: class Main
Main.java:21: error: cannot find symbol
      x = a * b;
          ^
  symbol:   variable a
  location: class Main
Main.java:21: error: cannot find symbol
      x = a * b;
              ^
  symbol:   variable b
  location: class Main
Main.java:22: error: cannot find symbol
      if (a < b){ swap = a; a = b; b = swap;}
          ^
  symbol:   variable a
  location: class Main
Main.java:22: error: cannot find symbol
      if (a < b){ swap = a; a = b; b = swap;}
              ^
  symbol:   variable b
  location: class Main
Main.java:22: error: cannot find symbol
      if (a < b){ swap = a; a = b; b = swap;}
                         ^
  symbol:   variable a
  location: class Main
Main.java:22: error: cannot find symbol
      if (a < b){ swap = a; a = b; b = swap;}
                            ^
  symbol:   variable a
  location: class Main
Main.java:22: error: cannot find symbol
      if (a < b){ swap = a; a = b; b = swap;}
                                ^
  symbol:   variable b
  location: class Main
Main.java:22: error: cannot find symbol
      if (a < b){ swap = a; a = b; b = swap;}
                                   ^
  symbol:   variable b
  location: class Main
Main.java:23: error: cannot find symbol
      r = a % b;
          ^
  symbol:   variable a
  location: class Main
Main.java:23: error: cannot find symbol
      r = a % b;
              ^
  symbol:   variable b
  location: class Main
Main.java:25: error: cannot find symbol
    		a = b;
    		^
  symbol:   variable a
  location: class Main
Main.java:25: error: cannot find symbol
    		a = b;
    		    ^
  symbol:   variable b
  location: class Main
Main.java:26: error: cannot find symbol
   			b = r;
   			^
  symbol:   variable b
  location: class Main
Main.java:27: error: cannot find symbol
   			r = a % b;
   			    ^
  symbol:   variable a
  location: class Main
Main.java:27: error: cannot find symbol
   			r = a % b;
   			        ^
  symbol:   variable b
  location: class Main
Main.java:29: error: cannot find symbol
      max = x/b; 
            ^
  symbol:   variable x
  location: class Main
Main.java:29: error: cannot find symbol
      max = x/b; 
              ^
  symbol:   variable b
  location: class Main
Main.java:33: error: incompatible types: possible lossy conversion from long to int
      int ans = M / max + 1;
                        ^
21 errors