Extremal - MarisaOJ: Marisa Online Judge

Extremal

Time limit: 1000 ms
Memory limit: 256 MB
Given an integer $n$ and a list $A$ of $n$ integers. Find the maximum and minimum value of $A$. ### Input - The first line contains a single integer $n$. - The second line contains $n$ integers $A_i$. ### Output - Print the maximum and minimum value of $A$. ### Constraints - $1 \le n \le 1000$. - $|a_i| \le 1000$. ### Example Input: ``` 5 1 0 3 -2 999 ``` Output: ``` 999 -2 ```