/* -*- coding: utf-8 -*- * * 1280.cc: No.1280 Beyond C - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 100000; const int MAX_M = 100000; /* typedef */ typedef long long ll; /* global variables */ ll as[MAX_N], bs[MAX_M]; /* subroutines */ /* main */ int main() { int n, m; ll c; scanf("%d%d%lld", &n, &m, &c); for (int i = 0; i < n; i++) scanf("%lld", as + i); for (int i = 0; i < m; i++) scanf("%lld", bs + i); sort(bs, bs + m); ll sum = 0; for (int i = 0; i < n; i++) { int k = upper_bound(bs, bs + m, c / as[i]) - bs; sum += m - k; } printf("%.10lf\n", (double)sum / ((ll)n * m)); return 0; }