Excavator (DIG .*)
Background
Who is the most virtual in the attached IDC? Class 2 and Class 1 ***! It feels good, right?
Description
Today, the zombie czy drove an excavator to school (......). But he found that his MZ was full, so he met many of his MZ along the way. At a 1 km/min speed (= 60 km/h ......) Drive the excavator forward. He finds that he will only encounter MZ at a certain time or a certain distance. Every time you encounter Mz, czy will not hesitate to take them along (^_^ ). But he is so imaginary that when I have an Mz, his speed drops to 1/(I + 1 ). Specifically, at the beginning, czy was moving forward at a speed of 1 km/min. The speed of one MZ was changed to 1/2/min, and the speed of two was changed to 1/3/min ...... And so on. Now, the question is, how long does it take for each MZ to arrive at school.
Format
Enter 2 numbers N and m in the first line, indicating the MZ number and the distance between czy and the school (km)
The next two to n + 1 rows are composed of strings and numbers.
Dist X indicates that an MZ occurs when the distance reaches x km.
Time X indicates that an MZ occurs when the time reaches X min.
Output an integer to indicate the time the school arrived. If division is not allowed, you can directly output the integer part.
Sample Input
2 20
Time 3
Dist 10
Sample output
47
Data range
For 30% of the data, n, m <= 50
For 50% data, n, m <= 2000
For 100% data, n, m <= 200000, x <= 10 ^ 9, ensure that all input numbers are integers.
Originally titled bzoj3431, enhanced data version
Because there are two restrictions on time and distance, you need to enumerate one of them and process the other during enumeration.
Problem solving http://www.cnblogs.com/zhber/p/4064829.html
4.10.31 simulation competition [excavator]