All tasks
Easyarraysloops

Maximum of an Array

Time limit 2 s · Memory 64 MB

Statement

The first line contains n, the second line contains n integers separated by spaces. Print the largest of them.

Constraints

1 ≤ n ≤ 10^5 -10^9 ≤ a_i ≤ 10^9

Examples

Input 1
5
3 9 2 7 1
Output 1
9
Input 2
4
-3 -1 -7 -2
Output 2
-1
Solve this task to unlock the editorial.

AI tutor

Stuck? Get a nudge — the tutor explains the idea, it never hands you the solution.