import java.util.Scanner; public class Problem3 { public static void main(String[] args) { // TODO Auto-generated method stub int i,j,k,val,n,max=-1; long sum=0; Scanner sc=new Scanner(System.in); n=sc.nextInt(); int a[] =new int[n]; for(i=0;imax) max=a[i]; } int prime[]=new int[max+1]; prime[0]=1; prime[1]=1; for(i=2;i<=Math.sqrt(max);i++) { // if(prime[i]==0) // prime[i]=0; for(j=2*i;j<=max;j=j+i) prime[j]=1; } int factor[]=new int[max+1]; factor[0]=0; factor[1]=1; for(i=2;i<=max;i++) { if(prime[i]==0) factor[i]=i+1; else { val=1; for(j=2;j<=Math.sqrt(i);j++) { if(i%j==0) { int div=i/j; val=val>factor[j]*div+1?val:factor[j]*div+1; if(div!=j) val=val>factor[div]*j+1?val:factor[div]*j+1; } } factor[i]=val; } } for(i=0;i