100 atcoder#ABC164D. [ABC164D] Multiple of 2019
[ABC164D] Multiple of 2019
Score : points
Problem Statement
Given is a string consisting of digits from 1
through 9
.
Find the number of pairs of integers () that satisfy the following condition:
Condition: In base ten, the -th through -th characters of form an integer that is a multiple of .
Constraints
- is a string consisting of digits from
1
through9
.
Input
Input is given from Standard Input in the following format:
Output
Print the number of pairs of integers () that satisfy the condition.
1817181712114
3
Three pairs - , , and - satisfy the condition.
14282668646
2
2119
0
No pairs satisfy the condition.