1. Abridged Problem Statement
-----------------------------
Given integers N, M, K and a list of N positive integers v₁…vₙ, count how many of them satisfy (vᵢ)^M ≡ 0 (mod K).

2. Detailed Editorial
----------------------
**Understanding the Task**
We have a sequence of N positive integers. For each element v, we want to raise it to the power M and check whether the result is divisible by K. That is, check if v^M mod K == 0. Finally, we output the count of such v.

**Constraints and Implications**
- N, M, K ≤ 10 000
- Each v ≤ 10 001
- Time limit is tight (0.25 s), so an O(N·M) algorithm is too slow in the worst case (10^8 multiplications).

**Key Observation: Fast Modular Exponentiation**
To compute v^M mod K efficiently, we use the binary exponentiation (a.k.a. exponentiation by squaring) algorithm. This reduces the exponentiation from O(M) multiplications to O(log M) multiplications under modulus K.

**Algorithm Steps**
1. Read N, M, K and the N values.
2. Initialize a counter `answer = 0`.
3. For each value v:
   a. Compute `r = v^M mod K` using fast modular exponentiation in O(log M).
   b. If r == 0, increment `answer`.
4. Print `answer`.

**Complexity**
- Each modular exponentiation takes O(log M) steps.
- Total is O(N·log M), which for N, M ≤ 10^4 is O(10^4·14) ≈ 1.4·10^5 modular multiplications, easily within the time limit.

3. C++ Solution
---------------------------------------
```cpp
#include <bits/stdc++.h>

using namespace std;

template<typename T1, typename T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& x) {
    return out << x.first << ' ' << x.second;
}

template<typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& x) {
    return in >> x.first >> x.second;
}

template<typename T>
istream& operator>>(istream& in, vector<T>& a) {
    for(auto& x: a) {
        in >> x;
    }
    return in;
};

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& a) {
    for(auto x: a) {
        out << x << ' ';
    }
    return out;
};

int n, m, k;
vector<int> a;

void read() {
    cin >> n >> m >> k;
    a.resize(n);
    cin >> a;
}

int pw(int x, int p) {
    int r = 1 % k;
    while(p) {
        if(p & 1) {
            r = r * 1ll * x % k;
        }

        x = x * 1ll * x % k;
        p >>= 1;
    }

    return r;
}

void solve() {
    // A number v^M is divisible by K iff v^M mod K == 0, computed with fast
    // modular exponentiation. Count how many values in the sequence satisfy
    // this.

    int answer = 0;
    for(int v: a) {
        answer += pw(v, m) == 0;
    }

    cout << answer << '\n';
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int T = 1;
    // cin >> T;
    for(int test = 1; test <= T; test++) {
        read();
        // cout << "Case #" << test << ": ";
        solve();
    }

    return 0;
}
```

4. Python Solution with Detailed Comments
------------------------------------------
```python
import sys
data = sys.stdin.read().split()
# Parse input
# data[0]=N, data[1]=M, data[2]=K, then N numbers follow
N, M, K = map(int, data[:3])
values = map(int, data[3:])

def mod_pow(base, exp, mod):
    """
    Compute (base^exp) % mod using binary exponentiation.
    Time complexity: O(log exp).
    """
    base %= mod
    result = 1 % mod
    while exp > 0:
        if exp & 1:                  # If current bit of exp is 1
            result = (result * base) % mod
        base = (base * base) % mod   # Square the base
        exp >>= 1                    # Shift exp right
    return result

answer = 0
for v in values:
    # If v^M mod K == 0, increment our count
    if mod_pow(v, M, K) == 0:
        answer += 1

print(answer)
```

5. Compressed Editorial
-----------------------
Use O(N·log M) time: for each v compute (v^M mod K) via binary exponentiation and count how many results equal zero.
