import java.util.*; import java.io.*; import java.math.*; import java.util.regex.Pattern; class Main{ static void solve(){ /* * いちばんおおいそいんすうをみつけてそうさする */ int n = ni(); int [] A = IntArray(n); int [] count = new int[1000000]; int max = 1; int base = 1; for(int i=0;i pr = prime_factorization(A[i]); for(int v : pr.keySet()) count[v]++; } for(int i=0;i<1000000;i++) { if(max < count[i]){ max = count[i]; base = i; } } int chain = 0; for(int i=0;i prime_factorization(int val) { Map map = new HashMap<>(); for(int i=2; i*i<=val;i++) { int count = 0; while(val % i == 0) { val /= i; count++; } if(count > 0) map.put(i,count); } if(val != 1) map.put(val,1); return map; } /* 定数 */ static PrintWriter output; static Scanner sc; static int Inf = 1010101010; static long Lnf = (long)1e18; static final long mod = 1000000007; static final long MOD = 998244353 ; /* タイポ誘発関数 */ static String cut(String S , int start, int end) { return S.substring(start,end);} static char cut(String S , int start) { return S.charAt(start);} static String tos(int val) { return Integer.toString(val);} static String tos(long val) { return Long.toString(val);} static int toi(String S) { return Integer.parseInt(S);} static long tol(String S) { return Long.parseLong(S);} /* 実装が面倒なやつ */ static boolean kaibun(String S) { StringBuilder s = new StringBuilder(); s.append(S); return s.reverse().toString().equals(S); } static boolean isNumber(String value) { boolean result = false; if (value != null) { Pattern pattern = Pattern.compile("^[0-9]+$|-[0-9]+$"); result = pattern.matcher(value).matches(); } return result; } static Map counter(int [] A) { HashMap count = new HashMap<>(); for(int i=0;i counter(long [] A) { HashMap count = new HashMap<>(); for(int i=0;i