Magic Forest
题号:NC15868
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld

题目描述

It’s universally acknowledged that there’re innumerable trees in the campus of HUST.

One day you find an endless forest consisting of magic trees. The forest can be described in such a strange way: initially you know N trees with the magic power a1,…,an. Then for every (i,j) (i can be equal to j) one tree with the magic power ai-aj and one tree with the magic power ai+aj will appear in the forest, then you know there will be 3N trees with the magic power . This process can be done repeatedly, so you know that the infinite forest contains innumerable trees. What you want to know is if there’s a tree with the magic power X.



输入描述:

The first line contains two integer N0 and M(1≤N0,M≤103), the number of trees you initially know and the number of queries.
The next line are N0 integer a1,…,an (1≤ai≤105) as described above.
Then followed M lines with each line a integer X(1≤X≤105) as described above.

输出描述:

For each query:
If there is no such a tree print “NO”.
Otherwise find a solution that X=∑ai×ki and print N integer ki, which should be no greater than 64-bits integer in a line. If there are multiple solutions, print any of them.
Warning: do not print extra space or empty line!
示例1

输入

复制
2 3
2 6
4
10
11

输出

复制
2 0
2 1
NO