import java.util.* fun main() { val builder = StringBuilder() val (n, m, c) = readInputLine().split(" ").map { it.toLong() } val aList = readInputLine().split(" ").map { it.toLong() } val bList = readInputLine().split(" ").map { it.toLong() }.sorted() var cnt = 0L for (a in aList) { cnt += m - upperBound(bList, c / a).toLong() } builder.appendln(cnt.toDouble() / (n * m).toDouble()) print(builder.toString()) } fun readInputLine(): String { return readLine()!! } fun > upperBound(list: List, value: T): Int { return Collections.binarySearch(list, value, {x, y -> if (x > y) 1 else -1}).inv() }