@@ -0,0 +1,1822 @@
+import java.io.*;%0Aimport java.math.*;%0Aimport java.security.*;%0Aimport java.text.*;%0Aimport java.util.*;%0Aimport java.util.concurrent.*;%0Aimport java.util.regex.*;%0A%0Apublic class Solution %7B%0A%0A    // Complete the flatlandSpaceStations function below.%0A    static int flatlandSpaceStations(int n, int%5B%5D c) %7B%0A        if(c.length==1)%7B%0A            return Math.max(c%5B0%5D,n-c%5B0%5D-1);%0A        %7D%0A        Arrays.sort(c);%0A        int max_distace = c%5B0%5D;%0A        int check = max_distace;%0A        //if()%0A        for(int i=1;i%3Cc.length;i++)%7B%0A            if(max_distace%3C(c%5Bi%5D-c%5Bi-1%5D)) max_distace=c%5Bi%5D-c%5Bi-1%5D;%0A        %7D%0A        if(check==max_distace %7C%7C ((max_distace/2)+1%3C(n-c%5Bc.length-1%5D))) return Math.max(check,n-1-c%5Bc.length-1%5D);%0A          //return n-1-c%5Bc.length-1%5D;%0A        if(max_distace==1) return 0;%0A        else%7B%0A            double x = max_distace/2;%0A            if(max_distace%252==0) return max_distace/2;%0A            %0A            else return (int)Math.ceil(x);%0A        %7D%0A    %7D%0A%0A    private static final Scanner scanner = new Scanner(System.in);%0A%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv(%22OUTPUT_PATH%22)));%0A%0A        String%5B%5D nm = scanner.nextLine().split(%22 %22);%0A%0A        int n = Integer.parseInt(nm%5B0%5D);%0A%0A        int m = Integer.parseInt(nm%5B1%5D);%0A%0A        int%5B%5D c = new int%5Bm%5D;%0A%0A        String%5B%5D cItems = scanner.nextLine().split(%22 %22);%0A        scanner.skip(%22(%5Cr%5Cn%7C%5B%5Cn%5Cr%5Cu2028%5Cu2029%5Cu0085%5D)?%22);%0A%0A        for (int i = 0; i %3C m; i++) %7B%0A            int cItem = Integer.parseInt(cItems%5Bi%5D);%0A            c%5Bi%5D = cItem;%0A        %7D%0A%0A        int result = flatlandSpaceStations(n, c);%0A%0A        bufferedWriter.write(String.valueOf(result));%0A        bufferedWriter.newLine();%0A%0A        bufferedWriter.close();%0A%0A        scanner.close();%0A    %7D%0A%7D%0A

add FlatlandSpaceStations.java