类似于K’th
二分+two point
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
long long l=0,r,k;
long long a[2100000],b[2100000];
int n,m;
bool check(long long mid)
{
long long t1=1,t2=m,sum1=0;
while(t1<=n&&t2>=1)
{
while(a[t1]*b[t2]>mid&&t2>=1) t2--;
sum1+=t2;
t1++;
}
return sum1<k;
}
void get_ans()
{
sort(a+1,a+n+1);
sort(b+1,b+m+1);
r=a[n]*b[m]+2;
while(l<=r)
{
long long mid=(l+r)/2;
if(check(mid)) l=mid+1;
else r=mid-1;
}
printf("%lld",l);
}
int main()
{
freopen("number.in","r",stdin);
freopen("number.out","w",stdout);
scanf("%d%d%lld",&n,&m,&k);
for(int i=1;i<=n;i++)
scanf("%d",&a[i]);
for(int i=1;i<=m;i++)
scanf("%d",&b[i]);
get_ans();
return 0;
}