fork(2) download
  1. #include <iostream>
  2. #include <cstdio>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. int a, b, c, d=0;
  8. scanf("%d %d", &a, &b);
  9. while (a--) {
  10. scanf("%d", &c);
  11. if(c%b==0) d++;
  12. }
  13. printf("%d", d);
  14. return 0;
  15. }
Success #stdin #stdout 0s 3300KB
stdin
7 3
1
51
966369
7
9
999996
11
stdout
4