#K54057. Furthest Frog Leap
Furthest Frog Leap
Furthest Frog Leap
You are given f frogs. Each frog is described by its starting position and its jumping power. When a frog leaps, it starts at its given position and moves forward by its jumping power. Mathematically, if a frog is at position \(p\) and has a jump power of \(j\), then after its leap it will be at the position \(p + j\).
Your task is to determine the furthest point any frog can reach with one leap. In other words, compute the maximum value of \(p + j\) among all frogs.
Input/Output Requirement: The program should read from standard input (stdin) and write the answer to standard output (stdout).
inputFormat
The first line contains an integer \(f\) representing the number of frogs. The next \(f\) lines each contain two integers \(p\) and \(j\), where \(p\) is the starting position and \(j\) is the jumping power of a frog.
Input Format:
f p1 j1 p2 j2 ... pf jf
outputFormat
Output a single integer which is the maximum distance any frog can reach after one leap; that is, the maximum value of \(p + j\) among all frogs.
## sample3
2 4
7 5
10 2
12