当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5872:Seats

题目描述
The yearly sports meeting is approaching in Hail university and $M$ departments, conveniently numbered from 1 to $M$, are going to take part in. Each department has no more than $h$ students.
  Now send $a_i$ students from the $i$-th department as spectators, such that $\sum\limits_{i=1}^{M}a_i=L$. There are $k$ seats every row on the grandstand and $L \bmod k = 0$. Students from the same department are required to sit in the same row. The question is how many rows should be arranged at least, to ensure that no matter of the values of $M$ and $a_1, \cdots, a_m$, all the students will be able to get seated.
输入解释
Multiple test cases, process till end of input.
  
  For each case, the one and only line contains three space-separated integers $h, L, k$ as stated above.
  
  You can assume that
  
     $0<h\le1000$
    
     $0<L\le1000000000$,
    
     $0<k\le1000000$, and
    
     $L \bmod k=0$.
输出解释
Output a positive integer $X$ on a single line showing the least rows needed.
输入样例
39 2020 202
输出样例
12
来自杭电HDUOJ的附加信息
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5872

最后修改于 2020-10-25T23:26:20+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/65536K(Java/Others)