Count Numbers Divisible by KEasy

Count Numbers Divisible by K

EasyPractice library · +10 XPdynamic programmingarraysbasic programming

Given a list of N integers, find out how many of them are perfectly divisible by a given integer K. Print this count.

Input

The first line contains two integers N and K. The second line contains N integers separated by spaces.

Output

Print a single integer: the count of numbers divisible by K.

Constraints

1 <= N <= 1000 1 <= K <= 1000 Each integer in the list is between -1000 and 1000.

Time limit 1 s (native code; slower languages get more)Memory 256 MB15 hidden tests

Example 1

Input
5 3
1 2 3 4 5
Output
1

Only 3 is divisible by 3, so the count is 1.

Example 2

Input
6 2
10 20 30 40 50 60
Output
6

All 6 numbers are divisible by 2, so the count is 6.

Hints