# ------------------------------------------------------------
# PSUT IoT Engineering Studio · E10
# Defensive analysis of synthetic records only; no network I/O.
# ------------------------------------------------------------
"""Nine prepared DoS comparison receipt counts 4,5,5,2,4,3,0,6,4 of ten."""
import json

# Editable defensive setting (only the documented choices are permitted).
CHOICES = [2, 4, 6, 8, 10]
DEFAULT = 6

def analyze(x):
    """Return independently interpretable defensive metrics."""
    if isinstance(x, bool) or x not in CHOICES:
        raise ValueError("Choose a documented defensive setting")
    return {
        'Total service shortfall': sum(max(0,x-v) for v in [4,5,5,2,4,3,0,6,4]),
        'Cases below target': sum(int(v<x) for v in [4,5,5,2,4,3,0,6,4]),
        'Mean delivered (%)': 330/9
    }

if __name__ == "__main__":
    for setting in CHOICES:
        print(json.dumps({"setting": setting, "metrics": analyze(setting)}))
