#CCBCHBAHAI0000073. Initializer đầy đủ (Full Array Initializer)
Initializer đầy đủ (Full Array Initializer)
Full Array Initializer
Source: Understanding and Using C Pointers
Version: Phuoc Hung OJ Extended
Problem Statement
Five integers describe a full initializer equivalent to
long long a[5] = {x0, x1, x2, x3, x4};
Every index from through receives the corresponding initializer value. Then queries follow; each query gives a valid index . Print .
Input
- The first line contains five integers .
- The second line contains .
- The third line contains exactly indices , each in .
Output
For each query, print the array element at the requested index on its own line.
Subtasks
Subtask 1 (20 points): , .
Subtask 2 (30 points): , .
Subtask 3 (50 points): , .
Examples
Input
1 2 4 8 16
4
0 2 4 1
Output
1
4
16
2
Explanation
The initializer creates . The queries ask for indices , so the answers are , , , and .