ll@N,@M,@K;char@O;ll@B[M],@A[N];sortA(N,A),sortA(M,B);wt(N*M-sum[i,0,N](lower_bound(B,B+M,O&1?K-A[i]:(K+A[i]-1)/A[i])-B));