Attention to the Meeting
Time limit1sMemory limit1024 MB
Given N speeches of equal length with 1-minute gaps between them and a K-minute limit, find the longest speech length that keeps the meeting within K.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Vinicius is at a board meeting of the Instituto de Consultoria de Palestras e Comentários (ICPC). He thinks it would be great if the board members kept their speeches within the time allotted to each director, so that the meeting could end before lunch. Unfortunately, perhaps due to the nature of the institution, everyone loves to talk.
There are directors who will speak at the meeting. Each director speaks for the same amount of time. There is a 1-minute interval between two consecutive speeches. Determine the maximum length of each speech, in minutes, so that the meeting lasts no more than minutes.
Input
The first line contains an integer (), the number of directors. The second line contains an integer ( and ), the maximum meeting duration in minutes. For all input cases, each director's speech lasts at least 1 minute.
Output
Output a single line containing a single integer, the length of each board member's speech in minutes.