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
Rafael da Silva Carrasco: 2011-04-19 23:47:37

Didn't like this one... It's not about coding skills, but about which functions are faster.

osb: 2011-04-01 15:25:26

How to quick read data In c++;
Use cin, cout;
I'm using 9.32 second
ios::sync_with_stdio(false); command line used.

YatsukoYin: 2010-06-27 15:25:14

Hi all!
Who can I speed up data reading in C#, like this
" David " https://www.spoj.pl/ranks/INTEST/lang=CS ?
Thanks a lot!

Daniel Macintyre: 2010-06-14 16:46:31

I got it! I was using iostream data inputs and outputs before. When I switched to stdio.h methods it worked!

Burdakov Daniel: 2010-04-21 16:30:37

It seems that input is 25Mb, not 2.5Mb)

My prog with length of buffer 2.6Mb fails, but with 26Mb accepted.


Jorat: 2010-02-27 20:22:54

>sankalp srivastava
Are you sure?

vivek: 2010-02-09 18:37:20

this problem has to be divided into three steps , firstly how to store large numbers , then perform mathematical operations upon them
so first store it in a character string
then for the modulus operator one has to apply a function


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