# -*- coding: utf-8 -*-
"""只跑 30 条/天 的两个情景，输出 M1/M2 分布"""
import importlib.util, sys
sys.stdout.reconfigure(encoding="utf-8")

spec = importlib.util.spec_from_file_location("mc", r"D:\Deepseek\douyin_fengdaquan\mc_revenue.py")
mc = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mc)

import statistics as st


def pct(xs, p):
    xs = sorted(xs)
    return xs[min(int(len(xs) * p), len(xs) - 1)]


def show(name, xs):
    print(f"  {name}: 均值 {st.mean(xs):,.0f} | 中位 {st.median(xs):,.0f} | P25 {pct(xs,.25):,.0f} | "
          f"P75 {pct(xs,.75):,.0f} | P90 {pct(xs,.9):,.0f} | P99 {pct(xs,.99):,.0f}")


for name in ["C_30条_质量稀释", "D_30条_质量保持"]:
    prof = mc.PROFILES[name]
    print(f"\n=== {name}（30 条/天，月发 900 条）===")
    a, b = mc.run(prof, mc.BOOST_2026, mc.HAIRCUT_2026)
    show("第1个月", a)
    show("第2个月", b)
    print(f"  折合每小时（按每天 5 小时剪辑）：第1月 {st.median(a)/150:,.0f} 元/时，第2月 {st.median(b)/150:,.0f} 元/时")
