Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long int ll;
- int main(){
- int n, m, x;
- cin >> n >> m >> x;
- int ans = 0;
- for(int i = 0; i < n; i++){
- for(int j = 0; j < m; j++){
- int aux; cin >> aux;
- if(__gcd(aux, x) > 1) ans++;
- }
- }
- cout << ans << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement