Wednesday, 7 March 2018

Enormous Input Test

Enormous Input Test

All submissions for this problem are available.

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/Outputwarning. 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 
 

Solutions


#include<stdio.h>
int main()
{
 int n,count=0,i;
  long x,y;
  scanf("%d %ld",&n,&x);
  for(i=0;i<n;i++)
  {
 scanf("%ld",&y);
  if(y%x==0)
  count++;
  }
printf("%d",count);
}

No comments:

Post a Comment

Reverse The Number

Reverse The Number All submissions for this problem are available. If an Integer   N , write a program to reverse the given number. ...