In order to ensure that the contestants find it easy to reach the regional contest site, the authority has prepared some robot-driven vehicles. The vehicles would visit n predetermined junctions and carry the contestants waiting there to the contest. There is a computer controlled Transportation Center (TC) that determines the number of seats of each vehicle and the time each vehicle leaves the contest site for the first time. When a new vehicle is needed, a request is made to the TC. Every new vehicle has fewer number of seats than the last vehicle if it is more than 3: the i-th vehicle has max(s − (i − 1) ∗ t, 3) seats (i = 1, 2, . . .). The first vehicle leaves the contest site just at 8:00am. When TC gets a request for a new vehicle, it prepares a new vehicle and right after 2 seconds of getting the request, the new vehicle leaves the contest site. If multiple requests are made at the same time, only one is considered. At the junction j, each vehicle does the following tasks. If there are more than one vehicle at j at the same time, they perform the tasks in order of their service times: the one with the longest service time goes first. Service time of a vehicle is the difference between current time and the time the vehicle left the contest site (which is at junction 0) for the first time.
2/2 • Next n − 1 lines each contain a non-negative integer. The i-th line (i = 1, 2, 3 . . .) contains the number of contestants waiting at the i-th junction. • The last line of the dataset contains the time limit (in seconds, less than 10000000). All integers on a single line are separated by exactly one space. Total number of contestants is at most 1000. The end of input is marked with a line consisting of ‘TheEnd’. Output For each set, print 2 lines. The first line contains the name of the set as it appears in the input. The second line contains the time (in seconds) needed to bring all the contestants to the contest, if the time is not more than the given time limit. Otherwise, print the number of contestants reached the contest by the time limit. Sample Input Dhaka2000 3 22 4 30 8 10 30 28 8 20 20 100 Dhaka2001 3 22 4 30 8 10 30 28 8 20 20 90 Dhaka2002 3 22 2 30 8 10 30 28 8 20 20 100 TheEnd Sample Output Dhaka2000 98 seconds needed Dhaka2001 22 contestants reached Dhaka2002 88 seconds needed