#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 struct value{ long long a,b; int ind; bool operator<(const value &another)const{ if (a * another.b != b * another.a){ return a* another.b < b * another.a; } return another.ind < ind; } }; int main(){ priority_queue Q; int n,m; cin>>n>>m; vector a(n),b(m); rep(i,n){ cin>>a[i]; } rep(i,m)cin>>b[i]; b.push_back(Inf32+5); rep(i,n){ value t; t.a = a[i]; t.b = b[0]; t.ind =i; Q.push(t); } rep(i,m){ auto t = Q.top(); Q.pop(); cout<