This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
a=int(input())
s=[1]
for i in range (a):
d=int(input())
s.append(d)
x=int(input())
z=a
while(z!=-1):
if(s[z]%2==0):
c=s[z]//2
s.pop(z)
if z!=a:
s.insert(z,c)
s.insert(z,c)
else :
s.append(c)
s.append(c)
z+=2
a+=1
z-=1
#print(s)
for i in range(x):
v=int(input())
print(s[v])
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |