@@ -0,0 +1,1190 @@
+import java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0A%0Apublic class BetweenTwoSets %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A%09        int n = in.nextInt();%0A%09        int m = in.nextInt();%0A%09        int counter=0;%0A%09        int%5B%5D a = new int%5Bn%5D;%0A%09        for(int a_i=0; a_i %3C n; a_i++)%7B%0A%09            a%5Ba_i%5D = in.nextInt();%0A%09        %7D%0A%09        int%5B%5D b = new int%5Bm%5D;%0A%09        for(int b_i=0; b_i %3C m; b_i++)%7B%0A%09            b%5Bb_i%5D = in.nextInt();%0A%09        %7D%0A%09        Arrays.sort(a);%0A%09        Arrays.sort(b);%0A%09        boolean flag=false;%0A%09        for (int i=a%5Ba.length-1%5D;i%3C=b%5B0%5D;i++) %7B%0A%09        %09for (int j=0;j%3Ca.length;j++) %7B%0A%09        %09%09if (i%25a%5Bj%5D==0)%0A%09        %09%09%09if (j==a.length-1) flag=true;%0A%09        %09%09%09else continue;%0A%09        %09%09else break;%0A%09        %09%09if (flag) %7B%0A%09        %09%09%09for (int k=0;k%3Cb.length;k++) %7B%0A%09        %09%09%09%09if (b%5Bk%5D%25i==0) %7B%0A%09        %09%09%09%09%09if (k==b.length-1)%0A%09        %09%09%09%09%09%09counter++;%0A%09        %09%09%09%09%09else%0A%09        %09%09%09%09%09%09continue;%0A%09        %09%09%09%09%7D else %7B%0A%09        %09%09%09%09%09break;%0A%09        %09%09%09%09%7D%0A%09        %09%09%09%7D%0A%09        %09%09%7D%0A%09        %09%7D%0A%09        %7D%0A%09        System.out.println(counter);%0A    %7D%0A%7D%0A

Create BetweenTwoSets.java