@@ -0,0 +1,815 @@
+import java.io.BufferedReader;%0Aimport java.io.InputStreamReader;%0A%0Apublic class WeirdSubstraction %7B%0A%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));%0A        String%5B%5D numbers = reader.readLine().split(%22 %22);%0A        long a = Long.parseLong(numbers%5B0%5D);%0A        long b = Long.parseLong(numbers%5B1%5D);%0A        while (true) %7B%0A            if (a == 0 %7C%7C b == 0) %7B%0A                break;%0A            %7D%0A            if (a %3E= 2 * b) %7B%0A                long r = a / (2 * b);%0A                a -= r * 2 * b;%0A            %7D else if (b %3E= 2 * a) %7B%0A                long r = b / (2 * a);%0A                b -= r * 2 * a;%0A            %7D else %7B%0A                break;%0A            %7D%0A        %7D%0A        System.out.println(a + %22 %22 + b);%0A    %7D%0A%7D%0A

Add WeirdSubstraction