题解:P17871 [FJCPC 2026] 抱歉,这没有集美

· · 题解

题意

集训队有 n 个人,其中有 m 个女生,解决两个问题:

思路

::::success[Code]

#include <cstdio>
#include <algorithm>
using namespace std;
int m, n, b;
int work(int x, int p) {return (x % p == 0 ? x / p : x / p + 1);}
int main() {
    int T;
    scanf("%d", &T);
    while (T--) {
        scanf("%d%d", &n, &m);
        b = n - m;
        int S = work(n, 3);
        int s = work(b, 3);
        printf("%d ", S - s);
        S = work(n, 10);
        s = m / 6;
        printf("%d\n", min(S, s));
    }
    return 0;
}

::::