ABC 449

https://atcoder.jp/contests/abc449

A. π

https://atcoder.jp/contests/abc449/tasks/abc449_a

void solve() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    double D;
    cin >> D;

    double r = D / 2;
    printf("%.9lf\n", r * r * M_PI);
}

B. Deconstruct Chocolate

https://atcoder.jp/contests/abc449/tasks/abc449_b

void solve() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    ll H, W, Q;
    cin >> H >> W >> Q;

    rep(i, Q) {
        ll t, x;
        cin >> t >> x;
        if (t == 1) {
            cout << x * W << endl;
            H -= x;
        } else {
            cout << H * x << endl;
            W -= x;
        }
    }
}

C. Comfortable Distance

https://atcoder.jp/contests/abc449/tasks/abc449_c

void solve() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    ll N, L, R;
    string S;
    cin >> N >> L >> R;
    cin >> S;

    int up = 26;
    vvll cms(up, vll(N + 1));
    rep(i, N) {
        int x = S[i] - 'a';
        cms[x][i + 1]++;
    }
    rep(i, up) {
        rep(j, N) {
            cms[i][j + 1] += cms[i][j];
        }
    }

    ll ans = 0;
    rep(i, N) {
        int x = S[i] - 'a';
        int l = min(i + L, N);
        int r = min(i + R + 1, N);
        ans += cms[x][r] - cms[x][l];
    }
    cout << ans << endl;
}

D. Make Target 2

https://atcoder.jp/contests/abc449/tasks/abc449_d

void solve() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    ll L, R, D, U;
    cin >> L >> R >> D >> U;

    ll ans = 0;
    rep(_, 2) {
        // |x| > |y| and |x| is even
        for (ll x = L; x <= R; x++) {
            if (x % 2 != 0) continue;
            ll ax = abs(x);
            ll d = max(-ax + 1, D);
            ll u = min(ax - 1, U);
            ans += max(u - d + 1, 0ll);
        }
        swap(L, D);
        swap(R, U);
    }

    vint sign = {1, -1};
    rep2(i, 1, (ll)1e6 + 5) {
        if (i % 2 != 0) continue;
        for (int sx : sign)
            for (int sy : sign) {
                ll x = sx * i, y = sy * i;
                if (clamp(x, L, R) == x && clamp(y, D, U) == y) {
                    ans++;
                }
            }
    }
    if (clamp(0ll, L, R) == 0 && clamp(0ll, D, U) == 0) {
        ans++;
    }

    cout << ans << endl;
}

E. A += v

https://atcoder.jp/contests/abc449/tasks/abc449_e

F. Grid Clipping

https://atcoder.jp/contests/abc449/tasks/abc449_f

G. Many Repunit Sum 2

https://atcoder.jp/contests/abc449/tasks/abc449_g