@@ -0,0 +1,1446 @@
+package java_problems.java_contests;%0D%0A%0D%0Aimport java.util.*;%0D%0A%0D%0Apublic class FindRobot %7B%0D%0A%0D%0A    public static void main(String%5B%5D args) %7B%0D%0A        Scanner sc = new Scanner(System.in);%0D%0A        System.out.println(%22Enter number of cases: %22);%0D%0A        int numCases = sc.nextInt();%0D%0A        System.out.println(%22Enter %22 + numCases + %22 test cases:%22);%0D%0A        for (int i = 0; i %3C numCases; i++) %7B%0D%0A            int numTurns = sc.nextInt();%0D%0A            int%5B%5D coordinates = findRobot(numTurns);%0D%0A            System.out.println(coordinates%5B0%5D + %22 %22 + coordinates%5B1%5D);%0D%0A        %7D%0D%0A        sc.close();%0D%0A    %7D%0D%0A    %0D%0A    public static int%5B%5D findRobot(int turns) %7B%0D%0A        int x = 0;%0D%0A        int y = 0;%0D%0A        int%5B%5D coords = new int%5B2%5D;%0D%0A        boolean right = true;%0D%0A        boolean up = true;%0D%0A        for (int numTurns = 1; numTurns %3C= turns; numTurns++) %7B%0D%0A            if (numTurns %25 2 == 1) %7B%0D%0A                if (right) %7B%0D%0A                    x += numTurns;%0D%0A                    right = false;%0D%0A                %7D else %7B%0D%0A                    x -= numTurns;%0D%0A                    right = true;%0D%0A                %7D%0D%0A            %7D else %7B%0D%0A                if (up) %7B%0D%0A                    y += numTurns;%0D%0A                    up = false;%0D%0A                %7D else %7B%0D%0A                    y -= numTurns;%0D%0A                    up = true;%0D%0A                %7D%0D%0A            %7D%0D%0A        %7D%0D%0A        coords%5B0%5D = x;%0D%0A        coords%5B1%5D = y;%0D%0A        return coords;%0D%0A    %7D%0D%0A%7D%0D%0A

Add FindRobot