6307 번 : Going in circles on Alpha Centauri 
 6307 번 
 6307 번 - Going in circles on Alpha Centauri 
 the average time it takes for a request to be fulfilled , i . e . the time between a ship requesting a cargo to be taken to another port , and the cargo actually being delivered to its destination , and 
 the utilization of the transrobs , i . e . the average percentage of transrobs serving requests during some interval of time 
 The transrobs are numbered 1 to m . 
 It takes a transrob 1 minute to get from a port to the next one , and it takes 5 minutes to load or unload a container at a port . 
 Transrobs move on different tracks , and therefore do not hinder each other when performing their duties . 
 Transrobs are either idle , or they are servicing a request , which means that they move to the origin of that request , load the cargo , move to the destination , unload the cargo , and become idle again . 
 All incoming requests are put in the request list . A request from that list is possible to satisfy if there is an idle transrob for which the cargo is not too heavy . 
 As long as ( or as soon as ) there are possible requests on the list , they are assigned to transrobs , giving precedence for older requests over newer requests . Each request is assigned to the transrob which is closest ( in anti - clockwise direction ) to the origin of the request , and for which the cargo is not too heavy . If there are two transrobs at the same distance , the one with the lower number gets assigned the request . Assigned requests are deleted from the request list . 
 The assignment procedure is instantenous , i . e . a robot starts moving in the instant it gets assigned a request , and a robot becomes idle ( and can get a new request ) in the instant it finishes unloading . 
 The input consists of the description of several simulations you have to perform . Each description starts with a line containing two integers , n and m , the number of ports and transrobs , respectively , satisfying 2 ≤ n ≤ 100 and 1 ≤ m ≤ 20 . The next m lines contain a single integer li each , the maximum load that transrob i can carry , measured in galactic tons . 
 The description of shipments is terminated by the line “ - 1 - 1 - 1 - 1 ” .