Editorial for Mock CCC '20 Contest 1 J5 - A Prime Problem


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Brute force over the length of the prefix and the suffix. For a given length, determine if the given prefix is prime or not. If it is, then try to compute the next largest prime bigger than the suffix. Otherwise, find the next largest prime for the prefix and then pick the smallest prime for the length of the suffix.


Comments

There are no comments at the moment.