#abc336e. E - Digit Sum Divisible
E - Digit Sum Divisible
Score: points
问题描述
在正整数 中,其数字和被定义为 的十进制表示中所有数字的和。例如,数字 的数字和为 。
一个正整数 被称为良数,当且仅当 可以被它的数字和整除。例如, 是一个良数,因为它可以被其数字和 整除。
现在给定一个正整数 ,请计算不大于 的良数有多少个?
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
The digit sum of a positive integer is defined as the sum of the digits in the decimal notation of . For example, the digit sum of is .
A positive integer is called a good integer when is divisible by its digit sum. For example, is a good integer because it is divisible by its digit sum of .
You are given a positive integer . How many good integers are less than or equal to ?
Constraints
- is an integer.
Input
The input is given from Standard Input in the following format:
Output
Print the number of good integers less than or equal to .
Sample Input 1
20
Sample Output 1
13
There are good integers less than or equal to : .
Sample Input 2
2024
Sample Output 2
409
Sample Input 3
9876543210
Sample Output 3
547452239
update @ 2024/3/10 01:25:34