#C7599. Even Distribution of People
Even Distribution of People
Even Distribution of People
Alice is an event organizer who needs to seat P people in R rows as evenly as possible. Each row will either have \(\lfloor P/R \rfloor\) or \(\lfloor P/R \rfloor + 1\) people. Your task is to determine the maximum and minimum number of people in any row.
In other words, if you distribute the people as evenly as possible among the rows, some rows might receive one extra person if the total number of people is not divisible by the number of rows. Compute the maximum number of people in a row (which is \(\lfloor P/R \rfloor + 1\) if there is a remainder) and the minimum number (which is simply \(\lfloor P/R \rfloor\)).
Note: When there are no people (i.e. \(P = 0\)), every row will have 0 people.
inputFormat
The input consists of a single line containing two space-separated integers (P) and (R), where 0 (\le) P (\le) 10^9 and 1 (\le) R (\le) 10^9.
outputFormat
Print a single line containing two space-separated integers: the maximum and minimum number of people that can be seated in any row.## sample
10 3
4 3