Chips
Time limit2sMemory limit2048 MB
Given k cans with n chips each, find the minimum and maximum number of minutes that can pass before Vasiliy takes an empty can.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Programmer Vasiliy bought cans of chips, with chips in each can. He is watching a movie and eating chips. After each minute of the movie, he takes one of the cans and eats a chip from it.
At a certain moment, Vasiliy took one of the cans, but there were no chips left in it. What is the minimum and maximum number of minutes that could have passed since the start of the movie?
Input
The input consists of a single line containing two integers and separated by a space: the number of cans and the number of chips in each can. ()
Output
Output two integers separated by a space: the minimum and maximum number of minutes that could have passed before Vasiliy took a can with no chips left.