#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int N,M,A[1 << 17],B[1 << 17]; long long C; void solve() { cin >> N >> M >> C; for(int i = 0;i < N;i++) cin >> A[i]; for(int i = 0;i < M;i++) cin >> B[i]; sort(A,A+N,greater()); sort(B,B+M); int bi = 0; long long num = 0; for(int i = 0;i < N;i++) { while(bi < M && (long long)A[i]*B[bi] <= C) bi++; num += M-bi; } long long den = (long long)N*M; cout << fixed << setprecision(16); cout << (double)num/den << endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int tt = 1; //cin >> tt; while(tt--) solve(); }