F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Seats

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 560    Accepted Submission(s): 190


Problem Description
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.
 

Input
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
Output a positive integer $X$ on a single line showing the least rows needed.
 

Sample Input
39 2020 202
 

Sample Output
12
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-05 21:42:33, Gzip enabled