import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long[] dyn; static long calculate(int no) { if(dyn[no]!=0) return dyn[no]; long maxmoves=-1;long value=0; for(int j=1;j<=no-1;j++) { if(no%j==0) { if(dyn[j]==0) { value= calculate(j)*(no/j)+1; } else { value= dyn[j]*(no/j)+1; } if(value>maxmoves) { maxmoves=value; } } } dyn[no] = maxmoves; return maxmoves; } static long longestSequence(long[] a) { Arrays.sort(a); long max=a[a.length-1]; dyn = new long[(int)max+1]; dyn[0]=0; dyn[1]=1; long ans=0; for(int i=0;i