Created
December 23, 2016 09:55
-
-
Save udit71992/c84f2c06ebea9ee2902e1a8027d10be8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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