@@ -0,0 +1,1369 @@
+//https://www.hackerrank.com/challenges/sherlock-and-gcd%0Aimport java.io.*;%0Aimport java.util.*;%0A%0Apublic class Solution %7B%0A    private final static String NO = %22NO%5Cn%22;%0A    private final static String YES = %22YES%5Cn%22;%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A        %0A        //For each test%0A        StringBuffer sb = new StringBuffer();%0A        for(byte T = Byte.parseByte(br.readLine()); T %3E 0; --T)%7B%0A            %0A            //INPUT%0A            byte N = Byte.parseByte(br.readLine());%0A            int%5B%5D A = new int%5BN%5D;%0A            N = 0;%0A            for(String s : br.readLine().split(%22 %22))%7B%0A                A%5BN++%5D = Integer.parseInt(s);%0A            %7D%0A            %0A            sb.append(solve(A, N) ? YES : NO);%0A        %7D%0A        System.out.print(sb);%0A    %7D%0A    %0A    private static boolean solve(int%5B%5D A, byte N)%7B%0A        //If array size %3C 2%0A        if (N %3C 2)%7B%0A            return false;%0A        %7D%0A        %0A        //Find GCD%0A        int curGcd = A%5B0%5D;%0A        for(int i = 1; curGcd %3E 1 && i %3C N; ++i)%7B%0A            curGcd = gcd(curGcd, A%5Bi%5D);%0A        %7D%0A        %0A        return curGcd %3C 2;%0A    %7D%0A    %0A    private static int gcd(int a, int b)%7B%0A        while (b != 0)%7B%0A            int c = b;%0A            b = a %25 b;%0A            a = c;%0A        %7D%0A        return a;%0A    %7D%0A%7D%0A

Create sherlock-and-gcd.java