/** * Sample solution to Jackpot * Author: Stein Norheim * * */ import java.util.*; import java.io.*; class Primes { public int[] primes; public int[] pfactor; public int n; public Primes(int maxPrime) { primes = new int[maxPrime]; pfactor = new int[maxPrime+1]; primes[0]=2; pfactor[1]=1; n=1; int i; int j; for (i=2; i<=maxPrime; i++) { for (j=0; (j1) { int primefactor = p.pfactor[periodicity]; factors[nfactors++]=primefactor; periodicity /= primefactor; } } int fullperiodicity=1; for (int j=0; j1000000000) System.out.println("More than a billion."); else System.out.println(fullperiodicity); } stdout.close(); } static void solve() throws IOException { } static void init() { tokens = new StreamTokenizer(stdin); tokens.resetSyntax(); tokens.whitespaceChars(0,32); tokens.wordChars(33,255); } }