#include #include #include struct str{ long long int value; long long int index1; long long int index2; }; std::vector V1,V2; bool operator<(str a, str b) { return a.valueh); else { while(ind>=0&&V1[i].value*V2[ind].value<=h) ind--; while(indh) ind++; sum += (V2.size()-ind); } } else { if(V1[i].value*V2[0].value>h); else if(V1[i].value*V2.back().value<=h) sum += V2.size(); else { while(ind=0&&V1[i].value*V2[ind].value>h) ind--; sum += (ind+1); } } } if(sum>=e) { ans = h; max = h-1; } else min = h+1; } printf("%lld\n",ans); for(int i=0;i