标签:多少 ble round https while pre ref com 其他
题目链接:https://codeforces.com/contest/1359/problem/A
先给第一个人分配尽可能多的牌,其余的牌数对其他人取下整是平均分的话一个人最少有多少张牌,取上整是平均分的话一个人最多有多少张牌,本题取上整。
#include <bits/stdc++.h> using namespace std; void solve() { int n, m, k; cin >> n >> m >> k; int a = min(m, n / k); int b = (m - a + k - 2) / (k - 1); cout << a - b << "\n"; } int main() { int t; cin >> t; while (t--) solve(); }
Educational Codeforces Round 88 (Rated for Div. 2) A. Berland Poker
标签:多少 ble round https while pre ref com 其他
原文地址:https://www.cnblogs.com/Kanoon/p/12989104.html