PROBLEM LINKS:
DIFFICULTY:
Medium
PREREQUISITES:
Math
SOLUTION:`
http://www.ioinformatics.org/locations/ioi05/contest/ioi2005-tasks-and-solutions-a4.pdf .
EDITORIALIST’S SOLUTION:
Can be found here.
Medium
Math
http://www.ioinformatics.org/locations/ioi05/contest/ioi2005-tasks-and-solutions-a4.pdf .
Can be found here.