import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long c=0; static long c1=0; static boolean isprime(long n) { if (n == 1) return false; if (n == 2 || n==3) return true; if (n%2 == 0 || n%3 == 0) return false; for (long i=5; i*i<=n; i=i+6) { if (n%i == 0 || n%(i+2) == 0) return false; } return true; } static long count(long n) { if(isprime(n)==true) return(n+1); //if-prime else { long i=3L; while(n%i!=0) i++; c = 1+((n/i)*count(i)); return(c); } } static long count_even(long n) { if(n==2) { return(3); } else { long i = n-1; // while(n%i!=0 && (i/2)%2==0) i--; while(i>2) { if(n%i==0) { if((i/2)%2!=0) { i--; } else {break;} } else { i--; } } if(i%2==0) { c1=1+((n/i)*count_even(i)); } else { c1=1+(i*count_even(n/i)); } return(c1); } } static long longestSequence(long[] a) { long count=0; int len=a.length; for(int i=0;i