#T404. 含k个3的数
含k个3的数
Description
Enter two positive integers m and k, where 1 < m < 100000 and 1 < k < 5. Determine whether m is divisible by 19 and contains exactly k instances of the digit '3'. If the conditions are satisfied, output "YES"; otherwise, output "NO".
For example, input: 43833 3, which meets the conditions, outputs "YES". If the input is: 39331 3, although there are three '3's, it is not divisible by 19, so the conditions are not met, and the output should be "NO".
Input Format
The values of m and k, separated by a single space.
Output Format
Output "YES" if the conditions are met, otherwise output "NO".
43833 3
YES
译文
CodesOnline