INTEST - Enormous Input Test

no tags 

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

hide comments
banglee: 2024-06-07 10:43:11

1.40 with python, using sys.stdin.buffer.readline

remember to put 'buffer', its so powerful

carmadillo: 2024-02-23 22:07:55

1.39 sec with Python

eoin8991: 2023-08-22 02:59:21

1.43 sec with Python

hellothere_12: 2022-09-26 20:46:01

0.2 in C++

ashutosh_028: 2021-11-04 07:42:24

0.80 in Java

jamesbhai7983: 2021-06-27 19:52:17

My solution completed, run time is 0.53 c++ g++ compiler

aman_rj: 2021-03-25 17:28:05

0.38 in C++

greedosaur: 2021-03-21 18:45:31

0.01sec in Mariolang

zero_paul23: 2021-02-09 17:22:57

0.76 - 0.79 in Java. IO using custom buffered reader and StringTokenizer. Much faster (0.26) with custom class from geeksForGeeks.com

Last edit: 2021-02-09 17:32:22
krishp: 2020-11-22 18:22:58

.26 seconds JAVA. For anyone wondering, you have to use a Fast Input. You can find the code here: https://pastebin.com/EzGz3WcM

It functions similar to scanner, but is a lot faster.

Last edit: 2020-11-27 23:02:33

Added by:adrian
Date:2004-11-09
Time limit:2.112s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: NODEJS PERL6 VB.NET
Resource:Idea put forward by Michael Mendelsohn