#!/usr/bin/env python3
"""Enumerate the numeric screen in §4.6 of the study."""
from itertools import combinations

VALUES = (*range(1, 11), *range(20, 100, 10), 100, 200, 300, 400)
TARGETS = set(VALUES) | set(range(33)) | {78, 93}

pairs = list(combinations(VALUES, 2))
counts = dict.fromkeys(("Sum", "Absolute difference", "Exact larger/smaller quotient",
                        "Any of the three", "Sum or one digit-sum of the sum"), 0)
for low, high in pairs:
    total = low + high
    quotient, remainder = divmod(high, low)
    hits = (total in TARGETS, high - low in TARGETS,
            remainder == 0 and quotient in TARGETS)
    results = (*hits, any(hits), hits[0] or sum(map(int, str(total))) in TARGETS)
    for label, hit in zip(counts, results):
        counts[label] += hit

print("Targets:", ", ".join(map(str, sorted(TARGETS))))
print(f"Equally weighted unordered pairs of distinct letters: {len(pairs)}")
for label, count in counts.items():
    print(f"{label}: {count}/{len(pairs)} ({count / len(pairs):.2%})")
