403864: GYM101343 F Certifications

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. Certificationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Dr. Samer have made an agreement with GX company to design certificates for each lecture in Innovation Programming Lab.

GX company gave Dr. Samer n offers, where the ith offer contains ai certificates. If Dr. Samer wants to take the ith offer, he must buy all the certificates given by this offer.

Dr. Samer wants to buy x certificates for each lecture and he wants to get the offer because it will reduce the cost to more than 50% for some offers. For each lecture, Dr. Samer will buy the minimum number of certification such that he will be able to give each student a certification. with the guarantee that he will spend the minimal amount of money.

Can you help Dr. Samer to know what is the number of certificates he need to buy for each lecture to get any acceptable offer?

Input

The first line contains an integer n (1  ≤  n  ≤  105), where n is the number of offers given by GX company.

The second line contains n integers a1, a2, ... an (1  ≤  ai  ≤  109), where ai is the number of certificates in the ith offer.

The third line contains an integer m (1  ≤  m  ≤  105), where m is the number of lectures in Innovation Programming Lab.

The fourth line contains m integers x1, x2, ... xm (1  ≤  xi  ≤  109), where xi is the number of certificates needed for the ith lecture.

Output

Print m lines. The ith line must contain an integer x, where x is the number of certificates that Dr.Samer will buy for the ith lecture.

If Dr. Samer cannot take any offer for the ith lecture, print "Dr. Samer cannot take any offer :(." (without quotes).

ExamplesInput
5
2 4 6 8 10
4
2 3 7 1
Output
2
4
8
2
Input
3
100 5 50
5
15 2 10 200 5
Output
50
5
50
Dr. Samer cannot take any offer :(.
5

加入题单

上一题 下一题 算法标签: