import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int prime(long p) { for(int i=2;i<=(p/2);i++) { if(p%i==0) { return 1; } } return 0; } static int small(long q) { for(int i=2;i<=(q/2);i++) { if(q%i==0) { return i; } } return 1; } static long longestSequence(long[] a,int n) { // Return the length of the longest possible sequence of moves. long sum=0; for(int i=0;i