#include <bits/stdc++.h>
using namespace std;
int main()
{
cin.tie(0);
ios_base::sync_with_stdio(0);
vector < pair < long long , long long > > vc;
long long n;
cin>>n;
for(long long i=1;i<=n;i++)
{
long long a,k=1;
cin>>a;
while(a%2==0)
{
a/=2;
k*=2;
}
vc.push_back({a,k});
}
for(long long i=1;i<n;i++)
{
vc[i].second+=vc[i-1].second;
}
for(auto [a,b]:vc)
{
cout<<a<<" "<<b<<"\n";
}
long long q,uk=0;
cin>>q;
while(q--)
{
long long a;
cin>>a;
while(vc[uk].second<a)
{
uk++;
}
cout<<vc[uk].first<<"\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... |