CF549F Yura and Developers
Description
Yura has a team of $ k $ developers and a list of $ n $ tasks numbered from $ 1 $ to $ n $ . Yura is going to choose some tasks to be done this week. Due to strange Looksery habits the numbers of chosen tasks should be a segment of consecutive integers containing no less than 2 numbers, i. e. a sequence of form $ l,l+1,...,r $ for some $ 1
Input Format
N/A
Output Format
N/A
Explanation/Hint
In the first sample there are three good segments:
1. $ [1;3] $ — the hardest task requires $ 3 $ man-hours, so there are tasks left that require $ 1 $ and $ 2 $ man-hours. A solution is to make first developer work on the first task for an hour, while second and third developers work on the second task. Each developer works exactly one hour.
2. $ [1;4] $ — the hardest task requires $ 4 $ man-hours, so there are tasks left that require $ 1 $ , $ 2 $ and $ 3 $ man-hours. If the first developer spends an hour on the first task and an hour on the third one, the second developer spends two hours on the second task and the third developer spends two hours on the third task, then they are done, since every developer worked exactly for two hours.
3. $ [3;4] $ — the hardest task requires $ 4 $ man-hours, so there is only one task left that requires $ 3 $ man-hours. A solution is to make each developer work for an hour.