#CCBCHBAHAI0000119. Khai báo và khởi tạo 1, 2, 4, 8, 16, 32 (Initialize 1, 2, 4, 8, 16, 32)
Khai báo và khởi tạo 1, 2, 4, 8, 16, 32 (Initialize 1, 2, 4, 8, 16, 32)
Initialize 1, 2, 4, 8, 16, 32
Source: C Primer Plus
Version: Phuoc Hung OJ Extended
Problem Statement
Consider the fully initialized array
int a[6] = {1, 2, 4, 8, 16, 32};
There are queries. Each query provides an index in . Print .
Input
- The first line contains .
- The second line contains exactly indices , each in .
Output
For each query, print the corresponding array element on its own line.
Subtasks
Subtask 1 (20 points): .
Subtask 2 (30 points): and no index is repeated.
Subtask 3 (50 points): ; indices may repeat.
Examples
Input
5
0 2 5 3 1
Output
1
4
32
8
2
Explanation
The array is . The queried indices are , so the corresponding values are .