Skip to content

Instantly share code, notes, and snippets.

@udit71992
Created December 23, 2016 09:55
Show Gist options
  • Save udit71992/c84f2c06ebea9ee2902e1a8027d10be8 to your computer and use it in GitHub Desktop.
Save udit71992/c84f2c06ebea9ee2902e1a8027d10be8 to your computer and use it in GitHub Desktop.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
/**
* Created by Udit Aggarwal on 19-12-2016.
*/
class CodeChef {
public static void main(String[] args) {
int n, k;
int t;
int count = 0;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
n = Integer.parseInt(br.readLine());
k = Integer.parseInt(br.readLine());
if (n <= Math.pow(10, 7) && k <= Math.pow(10, 7) && n > 0 && k > 0) {
for (int i = 0; i < n; i++) {
t = Integer.parseInt(br.readLine());
if (t < Math.pow(10, 9)) {
if (t % k == 0)
count++;
}
}
System.out.print(count);
} else {
System.out.print(count);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment