Read problems statements in Mandarin chinese, Russian and Vietnamese as well. 
Chef found a very useful open-source code for the current problem. Unfortunately, one fragment of code isn't optimized. Consider that problem: given an array D of size N and Q queries X to the following open-source code:

read X

for i = 1..N:

X = floor(X / D[i])

print X

Help Chef to optimize that code for all possible X, he will be very thankful :)

------ Input ------ 

The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.  The first line of each test case contains two integers - N and Q. The second line contains array D. The third line contains Q queries - X_{1}, X_{2}, ..., X_{Q}. 

------ Output ------ 

For every test case in single line output Q integers - for each X_{i} output result for this query.

------ Constraints ------ 

$1 ≤ T ≤ 1000$
$1 ≤ N, Q ≤ 10^{5}$
$1 ≤ X_{i}, D_{i} ≤ 10^{9}$
$ Sum of N over all test cases ≤ 3*10^{5}$
$ Sum of Q over all test cases ≤ 3*10^{5}$

------ Subtasks ------ 

$Subtask #1: (25 points)  sum of N over all test cases ≤ 3*10^{3} and sum of Q over all test cases ≤ 3*10^{3} $
$Subtask #2: (75 points)  Original constraints$

----- Sample Input 1 ------ 
2
2 3
2 3
5 100 8
3 2
2 2 2
16 8
----- Sample Output 1 ------ 
0 16 1
2 1
----- explanation 1 ------ 
Example case 1. [[5 / 2] / 3] = 0, [[100 / 2] / 3] = 16, [[8 / 2] / 3] = 1

Difficulty: MEDIUM

Solutions:
for _ in range(int(input())):
	(n, q) = map(int, input().split())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	f = 1
	for i in range(n):
		f = f * a[i]
	c = []
	for i in range(q):
		c.append(b[i] // f)
	print(*c)


T = int(input())
while T > 0:
	(N, Q) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	quer = list(map(int, input().split()))
	mult = 1
	for i in range(N):
		mult = mult * arr[i]
	for i in range(Q):
		quer[i] = str(int(quer[i] / mult))
	s = ' '.join(quer)
	print(s)
	T -= 1


T = int(input())
for i in range(T):
	(N, Q) = list(map(int, input().split()))
	D = list(map(int, input().split()))
	Qseries = list(map(int, input().split()))
	temp = 1
	for num in D:
		temp *= num
	ans = ''
	for Qsub in Qseries:
		if len(ans) == 0:
			ans = str(Qsub // temp)
		else:
			ans += ' ' + str(Qsub // temp)
	print(ans)


T = int(input())

def findX(N, Q, q):
	ans = ''
	for i in q:
		ans += str(i // N) + ' '
	print(ans[:-1])
for testcase in range(T):
	(N, Q) = map(int, input().split())
	n = list(map(int, input().split()))
	q = list(map(int, input().split()))
	multiplication = 1
	for number in n:
		multiplication *= number
	findX(multiplication, Q, q)


t = int(input())
for h in range(t):
	(N, Q) = list(map(int, input().split()))
	l1 = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	re = 1
	for i in l1:
		re = re * i
	l3 = [str(i // re) for i in l2]
	print(' '.join(l3))


from sys import stdin
for _ in range(int(stdin.readline())):
	stdin.readline()
	d = list(map(int, stdin.readline().split()))
	q = list(map(int, stdin.readline().split()))
	m = max(q)
	p = 1
	while d and p <= m:
		p *= d.pop()
	print(' '.join(map(lambda x: str(x // p), q)))


from sys import stdin
for _ in range(int(stdin.readline())):
	stdin.readline()
	p = 1
	for dx in map(int, stdin.readline().split()):
		p *= dx
	print(' '.join(map(lambda x: str(int(x) // p), stdin.readline().split())))


from sys import stdin
from functools import reduce
for _ in range(int(stdin.readline())):
	stdin.readline()
	p = reduce(lambda x, y: x * y, map(int, stdin.readline().split()))
	print(' '.join(map(lambda x: str(int(x) // p), stdin.readline().split())))


t = int(input())
for i in range(t):
	(n, q) = map(int, input().split())
	d = list(map(int, input().split()))
	k = list(map(int, input().split()))
	p = 1
	for i in d:
		p *= i
	for i in range(q):
		k[i] = k[i] // p
	print(*k)


for tc in range(int(input())):
	(n, q) = map(int, input().split())
	d = list(map(int, input().split()))
	x = list(map(int, input().split()))
	p = 1
	for i in d:
		p *= i
	for j in range(q):
		x[j] = x[j] // p
	print(*x)


t = int(input())
for I in range(t):
	(n, q) = map(int, input().split())
	d = list(map(int, input().split()))
	x = list(map(int, input().split()))
	p = 1
	for i in d:
		p *= i
	for i in range(q):
		x[i] = x[i] // p
	print(*x)


import sys
import os.path
import math
import heapq
import copy
from sys import stdin, stdout
from collections import *
from math import gcd, ceil, floor
from bisect import bisect
mod = int(1000000000.0 + 7)
if os.path.exists('Updated prg/Input3d.txt'):
	sys.stdout = open('Updated prg/Output3d.txt', 'w')
	sys.stdin = open('Updated prg/Input3d.txt', 'r')

def sinp():
	return input()

def ninp():
	return int(sinp())

def mapinp():
	return map(int, sinp().split())

def smapinp():
	return map(str, sinp().split())

def linp():
	return list(mapinp())

def sl():
	return list(sinp().split())

def prnt(a):
	print(a)

def prntl(a):
	print(a, end=' ')

def prntlist(l1):
	print(*l1)

def power(n):
	return 1 << n
for _ in range(ninp()):
	(N, Q) = mapinp()
	D = linp()
	X = linp()
	(div, result) = (1, [])
	for i in D:
		div = div * i
	for i in X:
		result.append(floor(i / div))
	prntlist(result)


t = int(input())
for i in range(t):
	(n, q) = map(int, input().split())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	p = 1
	for i in range(n):
		p *= a[i]
	for i in range(q):
		b[i] = b[i] // p
	print(*b)


t = int(input())
for loop in range(t):
	(n, q) = map(int, input().split())
	prodD = 1
	for val in input().split():
		prodD *= int(val)
	for val in input().split():
		print(int(int(val) / prodD), end='')
		q -= 1
		if q != 0:
			print(' ', end='')
	print()


t = int(input())
for loop in range(t):
	(n, q) = map(int, input().split())
	d = [int(val) for val in input().split()]
	prodD = 1
	for i in d:
		prodD *= i
	q = [int(val) for val in input().split()]
	for i in range(len(q)):
		print(int(q[i] / prodD), end='')
		if i < len(q) - 1:
			print(' ', end='')
	print()


import numpy
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	l1 = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	arr = numpy.array(l1)
	brr = numpy.array(l2)
	brr = brr // numpy.prod(arr)
	print(*brr)


import math
for i in range(int(input())):
	a = input()
	z = list(map(int, input().split()))
	s = 1
	for i in z:
		s *= i
	k = list(map(int, input().split()))
	k = list(map(lambda x: str(x // s), k))
	print(' '.join(k))


for test in range(int(input())):
	_ = input()
	D = list(map(int, input().split()))
	queries = list(map(int, input().split()))
	s = 1
	for i in D:
		s *= i
	queries = list(map(lambda x: str(x // s), queries))
	print(' '.join(queries))