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
Bryan Poulsen: 2016-02-26 22:56:10

Fastest I could get with PyPy was 0.93 seconds - tried every variation of standard in that I could think of.

Bryan Poulsen: 2016-02-26 22:24:07

Submitted in python 2.7.10 got TLE, resubmitted same solution in Pypy got AC in 1.02 seconds.

entcat: 2016-02-22 19:19:53

used simple brute force logic in python , submitted in python 2.7.10 got TLE, resubmitted in pypy got accepted . could anyone provide me a reason why that occured

狂徒归来: 2015-11-06 14:22:58

2.9s in RUST

Andres Mauricio Rondon Patiño: 2015-10-11 20:52:58

Scanf/Printf AC in 0.5s

gautams: 2015-08-18 19:06:32

Is there any other tricks other than getchar_unlocked in c??

Abhinandan Agarwal: 2015-07-27 08:22:35

0.11s with getchar_unlocked and .56 with scanf . stream input output functions take time around 5s here.

karthik1997: 2015-07-08 10:50:43

0.11 sec ac :D
fast scanning with getchar_unlocked.
try that and use long int n at end of input

Sue: 2015-06-28 15:01:55

0.63s with pas :))))

sqd: 2015-06-13 05:58:03

Did anyone pass this using Haskell?


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