The problem though has virtually the simple image logic to be figured out but it may cause to
most cruel spoj error "TIME LIMIT EXCEEDED".
The question has many different logic but the problem has been set to make use of an algorithm
known as "SIEVE OF ERASTOSTHENES".
This algo just sieves down the prime nos. .
You would surely love the algo.
Youtube link: https://www.youtube.com/watch?v=eKp56OLhoQs
Wikipedia link: http://en.wikipedia.org/wiki/Sieve_of_Erastosthenes
most cruel spoj error "TIME LIMIT EXCEEDED".
The question has many different logic but the problem has been set to make use of an algorithm
known as "SIEVE OF ERASTOSTHENES".
This algo just sieves down the prime nos. .
You would surely love the algo.
Youtube link: https://www.youtube.com/watch?v=eKp56OLhoQs
Wikipedia link: http://en.wikipedia.org/wiki/Sieve_of_Erastosthenes