@@ -0,0 +1,1209 @@
+//https://www.hackerrank.com/challenges/jim-and-the-orders%0Aimport java.io.*;%0Aimport java.util.*;%0A%0Apublic class Solution %7B%0A  public static void main(String%5B%5D args) throws IOException %7B%0A%0A    //Get input%0A    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A    final short N = Short.parseShort(br.readLine());%0A    final Fan%5B%5D fans = new Fan%5BN%5D;%0A    for(int i = 0; i %3C N; ++i)%7B%0A      String%5B%5D line = br.readLine().split(%22 %22);%0A      fans%5Bi%5D = new Fan((short)(i+1), Integer.parseInt(line%5B0%5D) + Integer.parseInt(line%5B1%5D));%0A    %7D%0A    br.close();%0A    %0A    //Sort fans%0A    Arrays.sort(fans, 0, N);%0A    %0A    //Print output%0A    StringBuffer sb = new StringBuffer();%0A    for(int i = 0; i %3C N; sb.append(fans%5Bi++%5D.id + %22 %22))%7B%7D%0A    System.out.print(sb);%0A  %7D%0A  %0A  private static class Fan implements Comparator%3CFan%3E, Comparable%3CFan%3E%7B%0A    public final short id;%0A    public final int time;%0A    %0A    public Fan(short id, int time)%7B%0A      this.id = id;%0A      this.time = time;%0A    %7D%0A    %0A    public int compare(Fan a, Fan b)%7B%0A      return (a.time %3C b.time) ? -1 : (a.time %3E b.time) ? 1 : (a.id %3C b.id) ? -1 : 1;%0A    %7D%0A    %0A    public int compareTo(Fan b)%7B%0A      return this.compare(this, b);%0A    %7D%0A  %7D%0A%7D%0A

Create jim-and-the-orders.java