import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long maxMoves(long n) { long toTheMax = 0; if (n==1) return 1; if (n==2) return 2; boolean divisible = false; for (int i=2; itoTheMax) toTheMax = potentialMax; } } if (!divisible) toTheMax = n; return toTheMax; } static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. int sum=0; for (int i=0; i