Олимпиадный тренинг

Задача 2956. Analysis of the digits of the number - 17


Задача

Темы: Цикл while
The first line contains the number n >= 0
The second line contains the number  B and the number k
Display
- the word YES, if the digit B occurs in the number more than k times
- the word NO, if the digit B occurs in the number less than k times
- number k, if digit B occurs exactly k times

Sample input and output
test number Input Output
1 45545
5 6
NO
 
2 45545
5 3
3