import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long move=0; static void count(long l,long r) { long k,t,p; if((r-l)%2==0) { k=(r-l)/2; move=move+k*3+1; } else { if(r-l==1) {move=move+1;} else { move=move+(r-l)+1; } } } static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. for(int i=0;i