#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 200005;
ll sz[N], l[N], a[N];
int main () {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, q;
cin >> n;
for (int i=1; i<=n; i++){
cin >> a[i];
sz[i] = a[i] & -a[i];
l[i] = a[i] / sz[i];
}
ll passed = 0;
int ind = 1;
cin >> q;
while (q--){
ll x; cin >> x;
while (passed + sz[ind] < x){
passed += sz[ind];
ind++;
}
cout << l[ind] << '\n';
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |