#P1901. 发射站
发射站
Description
There are energy transmitter stations arranged in a line. Each station has a pairwise distinct height and can simultaneously emit energy of value to both sides (stations at the ends can emit only to one side). The emitted energy is received only by the nearest and taller station on each side. Clearly, the energy from a station may be received by , , or other stations.
Please compute the amount of energy received by the station that receives the most energy.
Input Format
The first line contains an integer .
Lines through : line contains two integers and , denoting the height of the -th station and the value of the energy it emits.
Output Format
Output a single line containing the maximum energy received by any station. The answer fits in a 32-bit signed integer.
3
4 2
3 5
6 10
7
Hint
For of the testdata, .
For of the testdata, $1\le N\le 10^5, 1\le H_i\le 2\times 10^9, 1\le V_i\le 10^4$.
For of the testdata, $1\le N\le 10^6, 1\le H_i\le 2\times 10^9, 1\le V_i\le 10^4$.
Translated by ChatGPT 5
京公网安备 11011102002149号