Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/massiv-k-chi-element

Print the k-th element

Easy 1000 ms 128 MB 20%
Share

A positive integer $n$, an array of $n$ integers and a position $k$ ($1 \le k \le n$) are given. Find the element of the array at position $k$.

Choosing the array element at a given index

Input

The first line contains a positive integer $n$. The second line contains $n$ integers. The third line contains $k$.

Output

One integer — the element at position $k$.

Note

$1 \le n \le 10^{4}$
$-1000 \le a_{i} \le 1000$
$1 \le k \le n$

Examples

Input #1
5
10 20 30 40 50
3
Output #1
30
Input #2
1
-7
1
Output #2
-7

Sign in to submit a solution

Signing up is free and takes a minute.