#include using namespace std; using ll =long long; #define all(v) v.begin(),v.end() #define rep(i,a,b) for(int i=a;i=b;i--) ll INF=2e18; int main() { ios::sync_with_stdio(false); cin.tie(0); ll N,M;cin>>N>>M; vector A(N),B(M); for(ll i=0;i>A[i]; for(ll i=0;i>B[i]; priority_queue, vector>, function,tuple)>>S( [](tuple a,tuple b){ if(get<0>(a)*get<1>(b)!=get<1>(a)*get<0>(b)) return get<0>(a)*get<1>(b)(a)*get<0>(b); else return get<2>(a)>get<2>(b); } ); vector ind(N); for(ll i=0;i(v); cout<