import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long log2(long n) { return (long)(Math.log(n) / Math.log(2)); } static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. long ans = 0; for(int i=0;i