 # Confusion regarding problem Problem Code: INTEST

I think the output here should be 5 but it’s 4. Let me know if I’m wrong and thinking about the problem in the wrong direction.

The purpose of this problem is to verify whether the method you are using to read input data is sufficiently fast to handle problems branded with the enormous Input/Output warning. You are expected to be able to process at least 2.5MB of input data per second at runtime.

###Input

The input begins with two positive integers n k (n, k<=107). The next n lines of input contain one positive integer ti, not greater than 109, each.

### Output

Write a single integer to output, denoting how many integers ti are divisible by k.

### Example

Input:
7 3
1
51
966369
7
9
999996
11

Output: 4

Should not the output here be 5

How did you get 5?

Let me expain why it is 4,

n = 7, k = 3
t = 1 and 1 \bmod 3 = 1, so its not included in our answer
t = 51 and 51 \bmod 3 = 0, so ans = 1
t = 966369 and 966369 \bmod 3 = 0, so ans = 2
t = 7 and 7 \bmod 3 = 1, so ans remains 2
t = 9 and 9 \bmod 3 = 0, so ans = 3
t = 999996 and 999996 \bmod 3 = 0, so ans = 4
t = 11 and 11 \bmod 3 = 2, so ans remains 4.

Thus, our final answer is 4.

1 Like

I made a mistake understanding the problem. Here n is the number of lines and I thought 7 and 3 both are k and either one can be used as k.

1 Like