The Milk Store mstore.X Farmer Ran has built a store in which to sell his milk. He must decide when to open his store and how much to charge for his milk. For some time interval during the day, FR will open the store and incur a charge of (1 <= C <= 1,000,000) cents for each minute it is open. FR knows his N (1 <= N <= 2,000) potential customers well; he knows the time T_i (0 <= T_i <= 1440) that customer i will arrive and how much money P_i (0 <= P_i <= 1,000,000) he/she is willing to pay for milk. Of course, if a customer shows up when the store isn't open, or if Farmer Ran's price is too high, the customer won't buy milk. Determine the maximum profit FR can make by choosing the optimal price and store hours. PROBLEM NAME: mstore INPUT FORMAT: * Line 1: Two space-separated integers: N and C * Lines 2..N+1: Line i+1 describes customer i with two space-separated integers: T_i and P_i. SAMPLE INPUT: 8 13 2 115 8 157 11 56 15 129 19 158 35 137 50 116 59 129 OUTPUT FORMAT: * Line 1: A single integer that is the maximum profit FR can achieve SAMPLE OUTPUT: 231 OUTPUT DETAILS: FR will keep his shop open from time 8 through time 19. Also the third customer is willing to pay only 56 for the milk but it is not wise to keep the price that low. FJ sells the milk to 3 persons for 129 and gains 129*3-(19-8+1)*13=231.