Time limit
1000 ms
Memory limit
262144 kB
Source
Codeforces Round #285 (Div. 1)
Tags
implementation math *2800
Editorial
Announcement Tutorial
Descriptions:

Misha and Palindrome Degree

CodeForces - 504C