import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long ls(long a) { long max=0; boolean prime=true; if(a==1) return 1; for (long i = 2; i <= a / 2; i++) { if (a % i == 0) { max=Math.max(max, i*ls(a/i)); //System.out.println("i "+i+" a "+a+" max "+max); prime=false; } } if(prime) return a+1; return max+1; } static long longestSequence(long[] a) { long max=0; for(int i=0;i