Champernowne Count
InterviewTime limit1sMemory limit1024 MB
Count how many of the first n Champernowne words, the concatenations of 1 through m, are divisible by k.
- Level
Easy3 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
The th Champernowne word is formed by writing the first positive integers in order and concatenating them. For example, the 10th Champernowne word is "12345678910".
Given two positive integers and , count how many of the first Champernowne words are divisible by .
Input
The single line of input contains two integers and .
Output
Output a single integer, which is the count of the first Champernowne words divisible by .