#C2093. Highest Combined Price

    ID: 45371 Type: Default 1000ms 256MiB

Highest Combined Price

Highest Combined Price

Given a list of integer prices representing the prices of different books, the task is to compute the maximum sum obtainable by choosing any two books. In other words, you need to determine the sum of the two highest prices in the list.

Formally, let \(P = [P_1, P_2, \dots, P_n]\) be a list of prices with \(n \ge 2\). You need to compute

\(\max_{1 \leq i < j \leq n} (P_i + P_j)\)

The input is provided via standard input (stdin) and the output should be printed to standard output (stdout).

inputFormat

The first line of input contains an integer \(n\) (\(n \ge 2\)) representing the number of books. The second line contains \(n\) space-separated integers, each representing the price of a book.

outputFormat

Output a single integer representing the sum of the two highest prices from the given list.

## sample
5
150 200 90 120 250
450