Chirpy's Number Sequence
Easy+10 XP · +5 Auramathloopsdivisibility
Chirpy the bird loves singing numbers! He sings a sequence of numbers from 1 up to N. He wants to know how many numbers in his sequence are perfectly divisible by his favorite number, K.
Can you help Chirpy count them?
Input
A single line containing two integers, N and K.
Output
A single integer representing the count of numbers between 1 and N (inclusive) that are divisible by K.
Constraints
1 <= N <= 1000, 1 <= K <= 1000
Time limit 1 s (native code; slower languages get more)Memory 256 MB15 hidden tests
Example 1
Input
10 3
Output
3
Numbers divisible by 3 in the range [1, 10] are 3, 6, 9. The count is 3.
Example 2
Input
15 5
Output
3
Numbers divisible by 5 in the range [1, 15] are 5, 10, 15. The count is 3.
Hints
# Read the input from stdin and print the answer.
import sys
def main():
data = sys.stdin.read().split()
# your code here
main()
Example 1 input
10 3
Example 2 input
15 5