#include<iostream> #include<algorithm> #define FORE(S,T) for(int i=S;i<=T;i++) const int MAX=100005; typedef long long LL; using namespace std; bool cmp(int a,int b){     return a > b; } int main(){     int N[MAX],M[MAX],r,m,l,nn,mm,now;     LL mid,k,left,right,cnt,ans;     while(cin>>nn>>mm>>k){         FORE(1,mm)  cin>>M[i];         FORE(1,nn)  cin>>N[i];         sort(N+1,N+1+nn,cmp);         sort(M+1,M+1+mm,cmp);         left=(LL)N[nn] * M[mm];         right=(LL)N[1] * M[1];         ans = left;         while(left <= right){             mid = (left + right)>>1;             cnt = 0;             FORE(1 , nn){                 l = 1;r = mm;now = 0;                 while(l <= r){                     m = (l + r) >> 1;                     if((LL)M[m]*N[i] >= mid){                         l = m + 1;                         now = m;                     }                     else                         r = m - 1;                 }                 cnt += now;             }             if(cnt >= k){                 ans = mid;                 left = mid + 1;             }             else                 right = mid - 1;         }         cout<<ans<<endl;     }     return 0; }