Description 
Jimmy works in an express company.(吉米在一家快递公司工作) His job is to deliver the packages to customers as soon as possible.(他的任务是尽可能快的将包裹送到客户手中) He should deliver all the packages to their customers according to the orders before the end of the day, i.e. 24:00(他要将包裹按顺序在当天24时之前送到客户手中). Any delay should be fined heavily measured by the time he is late for. (如果迟到了就会按他迟到的时间处罚)It was a bad day. Jimmy' car was broken.(这是倒霉的一天,吉米的车坏了) And when he repaired it. It was exactly 24:00.(当他修改完车就已经是24时了) The only thing Jimmy thought then was to find a proper way to deliver to minimize the fine. (他唯一的想法就是找到一个方法送递而他又可以少罚)He took a look at the map and found that his current position and all the places he would go are on a circle road.(他看了一下地图,他邮寄的位址必须到一个环城路上) And he can drive his car to any place along the circle road clockwise or counter-clockwise(他可以顺时针或者逆时针的顺着环城路到达任意一个地方). He wanted you to help him to find the best way to minimize the fine. (他希望可以得到你的帮助来最小限度的被罚)The fine is described as follows: if Jimmy is late, he has to pay one dollar per minute for each undelivered package.(处罚的凭据是:每当一个包裹被晚到一分钟被罚1美元)
Input 
The input contains several test cases.(输入几个测试案例) 
The first line in each case contains an integer N, no more than 300, where (N-1) is the number of places he has to deliver to.(第一行包含一个整形数N,他不会大于300,数据N-1就是他要到达的地点)
 The following N lines describe N points including his current location and the (N-1) destinations he has to go to.
 These N points are described clockwise based on their locations from Jimmy's current location. Each line consists of two integers m and t. m is the number of packages ordered by this place, which is always 0 in the first line and positive integers in the other lines. t, measured in minute, represents the time to go from this point to the next (the next point of the (N-1)-th destinations is Jimmy's current location). A test case with N = 0 indicates the end of input, and this case should not be processed.
Output 
For each test case, you should output one line containing only an integer which is the minimum fine Jimmy has to pay. You can assume that the answer is less than 1000000000 for all test cases.Sample Input 
4
0 1
6 10
9 50
5 5
5
0 2
5 5
4 20
1 20
7 1
0Sample Output 
240
92
有一些我还没有翻译完毕,但是大体上应该知道一些了...求大哥们快帮小弟一把!不然小弟的媳妇就危险了

解决方案 »

  1.   

    The following N lines describe N points including his current location and the (N-1) destinations he has to go to.//以下的N行描述了N个点,这N个点包括他当前的位置和他必须去的N-1个点。
     These N points are described clockwise based on their locations from Jimmy's current location. Each line consists of two integers m and t. m is the number of packages ordered by this place, which is always 0 in the first line and positive integers in the other lines. t, measured in minute, represents the time to go from this point to the next (the next point of the (N-1)-th destinations is Jimmy's current location). //从吉米的当前位置起按照顺时间发现来描述这N个点。每一行由两个整数m 和t 组成。m是这个地方投递的包裹数量,m在第一行的时候是 0,在其它行是正整数。 t 表示从一个点到另一个点需要的时间,按分钟计算。(第(N-1)个描述的下一个点是吉米的当前位置)
      

  2.   

    A test case with N = 0 indicates the end of input, and this case should not be processed.//测试例子用N=0表示输出结束,并且这时候不能继续进行。Output 
    For each test case, you should output one line containing only an integer which is the minimum fine Jimmy has to pay. You can assume that the answer is less than 1000000000 for all test cases.//输出
    对于每一次测试例子,你应该输出一行带有表示吉米必须受罚的最小的最优的整数。可以假定对于所有的测试例子,答案小于1000000000。