import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static Long longestSequence(HashMap map,Long d){ if(map.get(d)!=null) return map.get(d); Long result=0l; if(d==1l){ result++; map.put(d,result); return result; } result=0l; for(Long temp=1l;temp<=d;temp++){ if(d%temp==0){ if((d/temp)==d) { if(1l+d>result) result=1l+d; } else{ long currentResult=1l+(temp)*longestSequence(map,d/temp); if(currentResult>result) result=currentResult; } } } map.put(d,result); return result; } static Long longestSequence(Long[] a) { HashMap map=new HashMap(); Long result=0l; for(int i=0;i