Editorial for COCI '09 Contest 4 #3 IKS
Submitting an official solution before solving the problem yourself is a bannable offence.
Let us examine one arbitrary prime,
Using the sieve of Eratosthenes for fast prime number generation solves this task under given constraints.
Comments