Igor and Interesting Numbers

CodeForces - 747F