INTEST - Enormous Input Test

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

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

hide comments
2012-04-29 12:55:34 Giorgos Christoglou
it is a tutorial problem not a classical problem ;)
2011-04-24 22:19:01 Piotr KÄ…kol
@Rafael da Silva Carrasco - Choosing the right (so optimal) function is also a skill. It'll make Your life easier and sometimes even make AC of TLE. ;-)
2011-04-19 23:56:58 Berthin Torres
i got ac with a simple algorithm :(
i used cpp & cstdio & long(to the numbers)
2011-04-19 23:47:37 Rafael da Silva Carrasco
Didn't like this one... It's not about coding skills, but about which functions are faster.
2011-04-01 15:25:26 osb
How to quick read data In c++;
Use cin, cout;
I'm using 9.32 second
ios::sync_with_stdio(false); command line used.
2010-06-27 15:25:14 YatsukoYin
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!
2010-06-14 16:46:31 Daniel Macintyre
I got it! I was using iostream data inputs and outputs before. When I switched to stdio.h methods it worked!
2010-04-21 16:30:37 Burdakov Daniel
It seems that input is 25Mb, not 2.5Mb)

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


2010-02-27 20:22:54 Jorat
>sankalp srivastava
Are you sure?
2010-02-09 18:37:20 vivek
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
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.