Maximum of each sequence P71753


Statement
 

pdf   zip

thehtml

Write a program that reads sequences of integer numbers and prints the maximum value of each sequence.

Input

Input contains several sequences. Each sequence begins with its number of elements n > 0, followed by n integer numbers.

Output

Print the maximum of every sequence, one per line.

Public test cases
  • Input

    10  10 30 40 50 60 30 40 15 10 20
    2   -54 -134
    4   1 1 1 1
    

    Output

    60
    -54
    1
    
  • Information
    Author
    Jordi Petit
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Python
    User solutions
    C C++ Java Python