#CCBCHBAHAI0000008. Hai đầu của mảng (Array Endpoints)
Hai đầu của mảng (Array Endpoints)
Array Endpoints
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
You are given an integer array of length with , indexed from to . The first element is and the last element is . Print these two values in that order.
Input
- The first line contains the integer , the number of array elements.
- The second line contains exactly integers in increasing index order.
Output
Print the two integers and , separated by one space.
Subtasks
Subtask 1 (20 points): , .
Subtask 2 (30 points): , for every .
Subtask 3 (50 points): , for every .
Examples
Input
5
8 6 7 5 3
Output
8 3
Explanation
The first element is . The last index is and the last value is . Therefore the output is 8 3.