#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define MOD 1000000007 int main() { int n, m; cin >> n >> m; ll c; cin >> c; vector a(n), b(m + 1); for (int i = 0; i < n; ++i) { cin >> a[i]; } b[0] = 0; for (int i = 1; i <= m; ++i) { cin >> b[i]; } sort(b.begin(), b.end()); double win = 0; for (int i = 0; i < n; ++i) { int ok = m, ng = 1; if (c < a[i] * b[ng]) { win += m; } else if (a[i] * b[ok] <= c) { win += 0; } else { while (1 < (ok - ng)) { int mid = (ok + ng) / 2; if (c < a[i] * b[mid]) { ok = mid; } else { ng = mid; } } win += m - ng; } } printf("%.15f\n", win / (1ll * n * m)); return 0; }