UVa 10200 - Prime Time

Just precalculate the results.