HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN111 Homeworks 2013-2015 > problem:


15-FallRE-10. 50853 - Parking Place

CEN111 Homeworks 2013-2015

Start: Jan.10.2015 at 10:00:00 AM
Finish: Jan.10.2015 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 15-FallHW-3. 50822 - Linked List
• 15-FallHW-4. 50823 - Secret Number
• 15-FallHW-5. 50824 - Sum of Group...
• 15-FallHW-6. 50825 - Drawing Polygon
• 15-FallPr-10. 50808 - Total Distance...
• 15-FallPr-50. 50812 - Total Discount...
• 15-FallPr-70. 50814 - Buying Books f...
• 15-FallPr-80. 50815 - Breaking the ...
• 15-FallRE-10. 50853 - Parking P...
• 15-FallRE-20. 50854 - Area of Trian...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Parking Place

You are writing a program for a parking place. Park area is designed as line of parking places. The director wants to respond fast for groups of cars. When a group cars come, they want to park on a continuous parking zone. The parking places are represented by integers which represents the time remaining to be free. (after this many minutes, the parking area will be free.)

Question: You are given the information about a parking place. Find the biggest parking area.

Input specification
You will be first given a number (n) the number of parking places where 0 ≤ n ≤ 5000. Then, in the following n lines, you will be given the time remaining for parking places. In the last line, you will be given the number of cars in the group and the time after which the group comes.

Output specification:
Show "No", if it is not possible to give one continues parking place for all cars. Otherwise, show the size of the biggest parking area.

Sample Input I
10
0
24
28
45
55
75
1
16
20
22
3 30
Sample Output I
4

Explanation: There are 3 cars coming after 30 minutes. Parking positions 1,2,3 and 7, 8, 9, 10 will be free after 30 minutes. So, the biggest continuous parking area is 4.



Для отправки решений необходимо выполнить вход.

www.contester.ru