import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static boolean isPrime(long num) { boolean flag=true; for(int i = 2; i <= Math.sqrt(a); ++i) { // condition for nonprime number if(num % i == 0) { flag = false; break; } } return flag; } static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. long moves=0; for(int i=0;i