#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=2e5+10;
ll v[maxn], qtd[maxn];
int main(){
ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
int n; cin >> n;
for(int i=1;i<=n;i++){
cin >> v[i];
for(int k=1;k<60;k++){
ll d=(1ll<<k);
if(v[i]%d){
qtd[i]=k-1;
break;
}
}
}
int q; cin >> q;
int id=1;
ll sum=(1ll<<qtd[1]);
while(q--){
ll x; cin >> x;
while(x>sum) sum+=(1ll<<qtd[++id]);
cout << (v[id]/(1ll<<qtd[id])) << 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... |