#C1275. Highest Card After Trade

    ID: 42211 Type: Default 1000ms 256MiB

Highest Card After Trade

Highest Card After Trade

You are given n cards with integer values. In a single trade, a player can exchange one card for another. Since the best trade would always yield the card with the maximum value, your task is to determine the highest card value that a player can obtain after exactly one trade.

The problem can be formalized as follows: Given an integer \( n \) and a list of integers \( cards = [a_1, a_2, \ldots, a_n] \), compute \[ \text{result} = \max\{a_1, a_2, \ldots, a_n\} \] Print the value of \(result\).

Note: The input is provided via standard input (stdin) and the output should be written through standard output (stdout).

inputFormat

The input consists of two lines:

  1. The first line contains a single integer \( n \) which denotes the number of cards.
  2. The second line contains \( n \) space-separated integers representing the card values.

outputFormat

Output a single integer which is the maximum card value obtainable after one trade.

## sample
3
5 9 7
9