1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! The `maxplus` soft-maximum that combines component totals.
/// Soft maximum over component scores.
///
/// A challenge is hard if any single stage is hard, so the result tracks the maximum; several
/// hard stages together add at most one further point. The specification states:
///
/// - `maxplus(m, 0, …, 0) == m`
/// - `maxplus(m, m, …, m) == m + 1`
/// - `maxplus(0, 0, …, 0) == 0`
/// - the result lies in `[m, m + 1]`
///
/// For `m = max(values)` and `s = sum(values)`, the definition is
/// `m + (s - m) / ((n - 1) · m)`.
///
/// The specification also claims monotonicity in each parameter. That claim is false for
/// `m < 1`: the partial derivative in the maximum parameter is `1 - (s - m) / ((n - 1) · m²)`,
/// which is negative whenever `s - m > (n - 1) · m²`, reachable only when `m < 1`. See the
/// crate-level documentation.
///
/// Returns `0.0` for an empty slice, and the single value for a one-element slice, where the
/// definition would divide by zero. SOLVE itself always passes exactly four values.
/// Rescales a `maxplus` result from `[0, 11]` onto the SOLVE range `[0, 10]`.
///
/// Multiplies before dividing so that a straight-10 assessment lands on exactly `10.0`;
/// scaling by a precomputed `10.0 / 11.0` overshoots.
pub