#K72867. Double the Maximum Width
Double the Maximum Width
Double the Maximum Width
You are given a list of n pairs of integers. Each pair contains two integers. The second integer of each pair denotes a width. Your task is to find the maximum width among all pairs and print its double.
More formally, given \( n \) pairs \((a_i, w_i)\) for \( i = 1, 2, \dots, n \), you need to compute:
[ 2 \times \max_{1 \le i \le n} {w_i} ]
Note: The first integer in each pair is provided but is not used in the computation.
inputFormat
The input is given via stdin and has the following format:
- The first line contains an integer \( n \) representing the number of pairs.
- Each of the following \( n \) lines contains two space-separated integers.
You can assume that \( n \ge 1 \).
outputFormat
Output a single integer to stdout which is equal to 2 times the maximum value among the second integers of all pairs.
## sample4
7 10
5 8
3 6
4 5
20