Codeforces Round #132 Problem E Periodical Numbers