@@ -0,0 +1,782 @@
+//https://www.hackerrank.com/challenges/reverse-game%0Aimport java.io.*;%0A%0Apublic class Solution %7B%0A%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        final StringBuffer sb = new StringBuffer();%0A        %0A        //INPUT%0A        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A        for(byte T = Byte.parseByte(br.readLine()); T %3E 0; --T)%7B%0A            final String%5B%5D input = br.readLine().split(%22 %22);%0A            final int N = Integer.parseInt(input%5B0%5D);%0A            final int K = Integer.parseInt(input%5B1%5D);%0A            %0A            //SOLVE%0A            final int I = (K %3C (N %3E%3E 1)) ? 1 + (K %3C%3C 1) : (N-1 - K) %3C%3C 1;%0A            %0A            //OUTPUT%0A            sb.append(I + %22%5Cn%22);%0A        %7D%0A        System.out.print(sb);%0A    %7D%0A%7D%0A

Create reverse-game.java