lanqiao/一桌多少人.c
2024-11-24 15:33:02 +08:00

40 lines
778 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 【问题描述】
// 小蓝准备请自己的朋友吃饭。小蓝朋友很多,最终吃饭的人总数达 2024 人(包括他自己)。
// 请问如果每桌最多坐 n 人,最少要多少桌才能保证每个人都能吃饭。
// 【输入格式】
// 输入一行包含一个整数 n 。
// 【输出格式】
// 输出一行包含一个整数,表示最少的桌数。
// 【样例输入】
// 10
// 【样例输出】
// 203
// 【样例输入】
// 8
// 【样例输出】
// 253
// 【评测用例规模与约定】
// 对于所有评测用例1 <= n <= 2024。
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int result = 2024 / n;
if (2024 % n != 0) {
result++;
}
printf("%d\n", result);
return 0;
}