import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long solve (long n){ int count=0;long x=n; while(n>1){ if((n%(n/2)==0)){ count+=n/2; } n>>=1; } //System.out.print(" "+count+" "); return count+x; } static long longestSequence(long[] a,int n) { long sum=0; for(int i=0;i