@@ -0,0 +1,1288 @@
+//https://www.hackerrank.com/challenges/bus-station%0Aimport java.io.*;%0Aimport java.util.*;%0A%0Apublic class Solution%7B%0A    public static void main(String%5B%5D args) throws Exception%7B%0A        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A        %0A        //Input%0A        int N = Integer.parseInt(br.readLine());%0A        short%5B%5D groups = new short%5BN%5D;%0A        N = 0;%0A        for(String str : br.readLine().split(%22 %22))%7B%0A            groups%5BN++%5D = Short.parseShort(str);%0A        %7D%0A        %0A        %0A        //Solve%0A        %0A        //Sum%0A        int%5B%5D sums = new int%5BN%5D;%0A        sums%5B0%5D = groups%5B0%5D;%0A        for(int i = 1; i %3C N; ++i)%7B%0A            sums%5Bi%5D = groups%5Bi%5D + sums%5Bi-1%5D;%0A        %7D%0A        %0A        //Find%0A        List%3CInteger%3E sizes = new ArrayList%3CInteger%3E();%0A        for(int i = 0; i %3C N; ++i)%7B%0A            if (sums%5BN-1%5D %25 sums%5Bi%5D == 0)%7B%0A                int j = i;%0A                for(int x = sums%5Bi%5D; j %3E= 0; j = Arrays.binarySearch(sums, j, N, x += sums%5Bi%5D))%7B%7D%0A                if (~j == N)%7B%0A                    sizes.add(sums%5Bi%5D);%0A                %7D%0A            %7D%0A        %7D%0A        %0A        //Output%0A        StringBuffer sb = new StringBuffer();%0A        for(int size : sizes)%7B%0A            sb.append(size + %22 %22);%0A        %7D%0A        System.out.print(sb);%0A    %7D%0A%7D%0A

Create bus-station.java