import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long maxMoves(long l) { long moves=0; if(l==0 || l==1) { return l; } if(l%2!=0) { return (l+1); } while(l!=1) { moves+=l; l=l>>1; } moves+=1; return moves; } static long longestSequence(long[] a) { long l,sum=0; for(int i=0; i