1. Abridged Problem Statement
Given N sealed boxes (each initially contains exactly one prize) and M winners who, one by one, pick a box uniformly at random (with replacement). A winner gets the prize only if the chosen box has never been opened before; otherwise they get a consolation certificate. After each pick the box is resealed. Compute the expected total number of prizes actually awarded.

2. Detailed Editorial

Let Xi be the indicator random variable for "box i is ever selected in the M draws." Then the total number of prizes awarded is
    S = ∑_{i=1..N} Xi.
By linearity of expectation,
    E[S] = ∑ E[Xi].
Since each draw is uniform over N boxes (with replacement), the probability that box i is never picked in M independent draws is
    P(Xi=0) = ((N−1)/N)^M.
Hence
    E[Xi] = 1 − ((N−1)/N)^M,
and so
    E[S] = N × (1 − ((N−1)/N)^M).

Alternative (telescoping‐sum) viewpoint:
  – On the first draw you always get a new box ⇒ contribution = 1.
  – On the second draw, the chance to get a new (previously unopened) box is (N−1)/N,
  – On the k-th draw, the chance is ((N−1)/N)^{k−1}.
Summing for k=1..M gives
    E[S] = ∑_{k=0..M−1} ((N−1)/N)^k
         = [1 − ((N−1)/N)^M] / [1 − (N−1)/N]
         = N × (1 − ((N−1)/N)^M).

Edge case: if N = 1, there is only one box, so exactly one prize is guaranteed.

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;

void read() { cin >> n >> m; }

void solve() {
    // Expected prizes = sum over winners of the probability that the winner
    // picks a box not yet opened. Before a winner picks, the probability that
    // any particular box is still sealed is ((n-1)/n) raised to the number of
    // previous picks, so the chance this winner opens a fresh box is that same
    // power. Summing the geometric series term by term: each term starts at 1
    // and is multiplied by (n-1)/n for the next winner.

    if(n == 1) {
        cout << "1.0\n";
        return;
    }

    double ans = 0, prob = 1.0 / n, add = 1.0;
    for(int pos = 0; pos < m; pos++) {
        ans += add;
        add *= (n - 1) * prob;
    }

    cout << fixed << setprecision(10) << ans << '\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

```python
import sys
import math

def main():
    data = sys.stdin.read().strip().split()
    n, m = map(int, data)

    # Edge case: only one box ⇒ exactly one prize
    if n == 1:
        print("1.0")
        return

    # Using the closed‐form expectation:
    # E = N * (1 - ((N-1)/N)^M)
    # Compute (N-1)/N once
    ratio = (n - 1) / n
    # pow(ratio, m) is ((N-1)/N)^M
    p_never = ratio**m
    expected = n * (1 - p_never)

    # Output with sufficient precision
    print(f"{expected:.10f}")

if __name__ == "__main__":
    main()
```

5. Compressed Editorial

- Define Xi = 1 if box i is chosen at least once in M draws; else 0.
- E[Xi] = 1 − ((N−1)/N)^M.
- By linearity, answer = N × (1 − ((N−1)/N)^M).
- Handle N=1 separately (answer=1).
