SCU 2007 warmup contest 26

B: The Primes