import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. for(int arr_i=0;arr_i1){ if(n%i==0){ count=count+i; n=i; k=a[arr_i]/i; i=n/2; } else{ i--; } } // return count; a[arr_i]+=count; } long sum=0; for(int r=0;r