Language: Java

1. import java.util.*;
2. class Main{
3.     public static void main(String[]args){
4.         Scanner cin=new Scanner(System.in);
5.         int numS;
6.         int numC;
7.         int count =0;
8.         int kx;
9.         int ky;
10.       int result;
11.       int temp;
12.         
13.         numS = cin.nextInt();
14.         numC = cin.nextInt();
15.         int student[] = new int[numS];
16.         int checkp[] = new int[numC];
17.         for(int i=0;i<numS;i++ ){
18.             student[count]=cin.nextInt();
19.             count++;
20.             student[count]=cin.nextInt();
21.             count++;
22.         }
23.         count = 0;
24.         for(int j=0;j<numC;j++ ){
25.             checkp[count]=cin.nextInt();
26.             count++;
27.             checkp[count]=cin.nextInt();
28.             count++;
29.         }
30.         for(int k=0;k<numS;k++){
31.             kx = student[2*k];
32.             ky = student[2*k+1];
33.             result = 0;
34.             temp = 900000000;
35.             for(int m=0;m<numC;m++){
36.                 if(temp < Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1])){
37.                     temp = Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1]);
38.                     result = m;
39.                  }
40.             }    
41.             System.out.println(result);
42.         }
43.     }
44. }


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
1. import java.util.*;
^
Main.java:2: error: class, interface, enum, or record expected
2. class Main{
^
Main.java:3: error: illegal start of type
3.     public static void main(String[]args){
^
Main.java:4: error: not a statement
4.         Scanner cin=new Scanner(System.in);
^
Main.java:4: error: ';' expected
4.         Scanner cin=new Scanner(System.in);
  ^
Main.java:5: error: not a statement
5.         int numS;
^
Main.java:5: error: ';' expected
5.         int numS;
  ^
Main.java:6: error: not a statement
6.         int numC;
^
Main.java:6: error: ';' expected
6.         int numC;
  ^
Main.java:7: error: not a statement
7.         int count =0;
^
Main.java:7: error: ';' expected
7.         int count =0;
  ^
Main.java:8: error: not a statement
8.         int kx;
^
Main.java:8: error: ';' expected
8.         int kx;
  ^
Main.java:9: error: not a statement
9.         int ky;
^
Main.java:9: error: ';' expected
9.         int ky;
  ^
Main.java:10: error: not a statement
10.       int result;
^
Main.java:10: error: ';' expected
10.       int result;
   ^
Main.java:11: error: not a statement
11.       int temp;
^
Main.java:11: error: ';' expected
11.       int temp;
   ^
Main.java:12: error: not a statement
12.         
^
Main.java:12: error: ';' expected
12.         
   ^
Main.java:14: error: not a statement
14.         numC = cin.nextInt();
^
Main.java:14: error: ';' expected
14.         numC = cin.nextInt();
   ^
Main.java:15: error: not a statement
15.         int student[] = new int[numS];
^
Main.java:15: error: ';' expected
15.         int student[] = new int[numS];
   ^
Main.java:16: error: not a statement
16.         int checkp[] = new int[numC];
^
Main.java:16: error: ';' expected
16.         int checkp[] = new int[numC];
   ^
Main.java:17: error: not a statement
17.         for(int i=0;i<numS;i++ ){
^
Main.java:17: error: ';' expected
17.         for(int i=0;i<numS;i++ ){
   ^
Main.java:18: error: not a statement
18.             student[count]=cin.nextInt();
^
Main.java:18: error: ';' expected
18.             student[count]=cin.nextInt();
   ^
Main.java:19: error: not a statement
19.             count++;
^
Main.java:19: error: ';' expected
19.             count++;
   ^
Main.java:20: error: not a statement
20.             student[count]=cin.nextInt();
^
Main.java:20: error: ';' expected
20.             student[count]=cin.nextInt();
   ^
Main.java:21: error: not a statement
21.             count++;
^
Main.java:21: error: ';' expected
21.             count++;
   ^
Main.java:22: error: not a statement
22.         }
^
Main.java:22: error: ';' expected
22.         }
   ^
Main.java:23: error: not a statement
23.         count = 0;
^
Main.java:23: error: ';' expected
23.         count = 0;
   ^
Main.java:24: error: not a statement
24.         for(int j=0;j<numC;j++ ){
^
Main.java:24: error: ';' expected
24.         for(int j=0;j<numC;j++ ){
   ^
Main.java:25: error: not a statement
25.             checkp[count]=cin.nextInt();
^
Main.java:25: error: ';' expected
25.             checkp[count]=cin.nextInt();
   ^
Main.java:26: error: not a statement
26.             count++;
^
Main.java:26: error: ';' expected
26.             count++;
   ^
Main.java:27: error: not a statement
27.             checkp[count]=cin.nextInt();
^
Main.java:27: error: ';' expected
27.             checkp[count]=cin.nextInt();
   ^
Main.java:28: error: not a statement
28.             count++;
^
Main.java:28: error: ';' expected
28.             count++;
   ^
Main.java:29: error: not a statement
29.         }
^
Main.java:29: error: ';' expected
29.         }
   ^
Main.java:30: error: not a statement
30.         for(int k=0;k<numS;k++){
^
Main.java:30: error: ';' expected
30.         for(int k=0;k<numS;k++){
   ^
Main.java:31: error: not a statement
31.             kx = student[2*k];
^
Main.java:31: error: ';' expected
31.             kx = student[2*k];
   ^
Main.java:32: error: not a statement
32.             ky = student[2*k+1];
^
Main.java:32: error: ';' expected
32.             ky = student[2*k+1];
   ^
Main.java:33: error: not a statement
33.             result = 0;
^
Main.java:33: error: ';' expected
33.             result = 0;
   ^
Main.java:34: error: not a statement
34.             temp = 900000000;
^
Main.java:34: error: ';' expected
34.             temp = 900000000;
   ^
Main.java:35: error: not a statement
35.             for(int m=0;m<numC;m++){
^
Main.java:35: error: ';' expected
35.             for(int m=0;m<numC;m++){
   ^
Main.java:36: error: not a statement
36.                 if(temp < Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1])){
^
Main.java:36: error: ';' expected
36.                 if(temp < Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1])){
   ^
Main.java:37: error: not a statement
37.                     temp = Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1]);
^
Main.java:37: error: ';' expected
37.                     temp = Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1]);
   ^
Main.java:38: error: not a statement
38.                     result = m;
^
Main.java:38: error: ';' expected
38.                     result = m;
   ^
Main.java:39: error: not a statement
39.                  }
^
Main.java:39: error: ';' expected
39.                  }
   ^
Main.java:40: error: not a statement
40.             }    
^
Main.java:40: error: ';' expected
40.             }    
   ^
Main.java:41: error: not a statement
41.             System.out.println(result);
^
Main.java:41: error: ';' expected
41.             System.out.println(result);
   ^
Main.java:42: error: not a statement
42.         }
^
Main.java:42: error: ';' expected
42.         }
   ^
Main.java:43: error: not a statement
43.     }
^
Main.java:43: error: ';' expected
43.     }
   ^
Main.java:44: error: illegal start of type
44. }
^
82 errors