Classy Numbers

hard
https://codeforces.com/problemset/problem/1036/C

Input Format

Check the link

Output Format

Check the link

Constraints

Check the link

Notice

Check the link

Example

Input
Check the link
Output
Check the link
Next
Total Palindromic Numbers

Related Questions