#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define vi vector<long long>
#define all(x) x.begin(), x.end()
#define endl "\n"
void solution();
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
solution();
return 0;
}
vi a;
void solution() {
int n; cin >> n;
for (int i = 0; i < n; i++) {
ll x; cin >> x;
ll temp = x;
while (x&1^1) {
x/=2;
}
for (int j = 0; j < temp/x; j++) a.push_back(x);
}
int q; cin >> q;
while (q--) {
int x; cin >> x; x--;
cout << a[x] << endl;
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |