import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. // Find Factors int size = 1000001; boolean[] isPrime = new boolean[size]; List primeList = new ArrayList(); for(int i=0;i factor = new ArrayList(); List count = new ArrayList(); for(int j=0;j0){ factor.add(0l+primeList.get(j)); count.add(c); } } if(num > 1000000){ factor.add(num); count.add(1); } long parts = 1; long onePartSize = a[i]; for(int j=factor.size()-1;j>=0;j--){ for(int k=0;k