Algorithm
. problem Link : https://www.codechef.com/problems/INTEST
Problem
You are given integers. Find the count of numbers divisible by .
Input Format
The input begins with two positive integers , . The next lines contains one positive integer each denoted by .
Output Format
Output a single number denoting how many integers are divisible by .
Constraints
Sample 1:
Input
Output
7 3 1 51 966369 7 9 999996 11
4
Explanation:
The integers divisible by are and . Thus, there are integers in total.
Code Examples
#1 Code Example with C Programming
Code -
C Programming
#include<stdio.h>
int main()
{
int n,k,num,count=0;
scanf("%d %d",&n,&k);
while(n--)
{
scanf("%d",&num);
if(num%k==0)
{
count++;
}
}
printf("%d\n",count);
}
Copy The Code &
Try With Live Editor
Input
7 3
1
51
966369
7
9
999996
11
1
51
966369
7
9
999996
11
Output
4
Demonstration
CodeChef solution INTEST - Enormous Input Test in Codechef solution in C,C++