import math

def run_sir(total_pop, initial_infected, beta, gamma, days, vax_rate):
    # S: Susceptible | I: Infected | R: Recovered/Removed
    
    # Initial state: Vaccinated individuals are removed from Susceptible immediately (Shield effect)
    S = total_pop * (1.0 - vax_rate) - initial_infected
    I = initial_infected
    R = total_pop * vax_rate
    
    max_infected = I
    total_cases = I
    
    # Run simulation (Discrete time step = 1 day)
    for _ in range(days):
        if total_pop > 0:
            # Force of infection
            force = (beta * I) / total_pop
            # New infections cannot exceed susceptible population
            new_infected = min(S, force * S)
        else:
            new_infected = 0
            
        # Recovery
        new_recovered = gamma * I
        
        # Update states
        S = max(0, S - new_infected)
        I = max(0, I + new_infected - new_recovered)
        R = min(total_pop, R + new_recovered)
        
        if I > max_infected:
            max_infected = I
        
        total_cases += new_infected
            
    return max_infected, total_cases

print(f"{'SCENARIO':<25} | {'VAX %':<8} | {'PEAK I':<10} | {'TOTAL':<10} | {'OUTCOME'}")
print("-" * 75)

# Measles-like parameters: R0=15, Gamma=0.1 (10 days), Beta=1.5
total_pop = 10000
beta = 1.5
gamma = 0.1
days = 60

scenarios = [
    ("The 'Natural' Village", 0.00),
    ("The 'Skeptic' Town", 0.50),
    ("The 'Fortress' City", 0.95)
]

for name, rate in scenarios:
    peak, total = run_sir(total_pop, 1, beta, gamma, days, rate)
    
    if total < 50:
        outcome = "CONTAINED"
    elif total < total_pop * 0.6:
        outcome = "MITIGATED"
    else:
        outcome = "EPIDEMIC"
        
    print(f"{name:<25} | {rate*100:>7.1f}% | {int(peak):>10} | {int(total):>10} | {outcome}")
