#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 + 2); for (int i = 0; i < n; ++i) { cin >> a[i]; } for (int i = 1; i <= m; ++i) { cin >> b[i]; } b[0] = 0, b[m + 1] = 1e18 + 1; ll win = 0; sort(b.begin(), b.end()); for (int i = 0; i < n; ++i) { int ok = n + 1, ng = 0; while (1 < abs(ok - ng)) { int mid = (ok + ng) / 2; if (c < a[i] * b[mid]) { ok = mid; } else { ng = mid; } } win += n - ok + 1; } printf("%.15f\n", (double)(win) / (n * m)); return 0; }