package hackerrank;

import java.util.Scanner;

/**
 * https://www.hackerrank.com/challenges/jim-and-the-orders
 */
public class JimAndTheOrders {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // TODO
    }
}

@@ -14,16 +14,41 @@
 rrank;%0A%0A
+import java.util.Arrays;%0A
 import j
@@ -174,108 +174,987 @@
    p
-ublic static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        // TODO
+rivate static class IdxTime implements Comparable%3CIdxTime%3E %7B%0A        private final int idx;%0A        private final int time;%0A%0A        public IdxTime(int idx, int time) %7B%0A            this.idx = idx;%0A            this.time = time;%0A        %7D%0A%0A%0A        @Override%0A        public int compareTo(IdxTime o) %7B%0A            return Integer.compare(time, o.time);%0A        %7D%0A    %7D%0A%0A    private static void jimAndTheOrders(IdxTime%5B%5D idxTimes) %7B%0A        Arrays.sort(idxTimes);%0A        for (int i = 0; i %3C idxTimes.length; i++) %7B%0A            System.out.print(idxTimes%5Bi%5D.idx + %22 %22);%0A        %7D%0A        System.out.println();%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int n = in.nextInt();%0A        IdxTime%5B%5D idxTimes = new IdxTime%5Bn%5D;%0A        for (int i = 0; i %3C n; i++) %7B%0A            int t = in.nextInt();%0A            int d = in.nextInt();%0A            idxTimes%5Bi%5D = new IdxTime(i + 1, t + d);%0A        %7D%0A        jimAndTheOrders(idxTimes);
 %0A   

Solve Jim and the Orders