import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { ArrayList breakdown = new ArrayList(); private class Break { long fac; long score; Break(long _fac, long _score) { fac = _fac; score = _score; } } static long longestSequence(long[] a) { int s = 0; for(long l : a) s += seq(l); return s; } private static long seq(long n) { if(n == 1) return 1; long score = 1 + n; if(isPrime(n)) return score; for(long i = n/2; i>1; i--) { if(n % i == 0) { long s = 1 + (seq(n/i)*i); if (s > score) score = s; } } return score; } private static boolean isPrime(long n) { if(n > 2 && n % 2 == 0) return false; int max = (int) (Math.sqrt(n) + 1); for(int i=3; i