import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] as = new int[n]; for (int i = 0; i < n; i++) { as[i] = sc.nextInt(); } int[] bs = new int[n]; for (int i = 0; i < n; i++) { bs[i] = sc.nextInt(); } ArrayList permuration = getPermuration(n); int size = permuration.size(); int win = 0; for (int[] aArr : permuration) { for (int[] bArr : permuration) { int count = 0; for (int i = 0; i < n; i++) { if (as[aArr[i]] > bs[bArr[i]]) { count++; } } if (count * 2 > n) { win++; } } } System.out.println((double)win / size / size); } static ArrayList getPermuration(int n) { ArrayList ans = new ArrayList<>(); makePermuration(0, new int[n], new boolean[n], ans, n); return ans; } static void makePermuration(int idx, int[] arr, boolean[] used, ArrayList ans, int size) { if (idx == size) { ans.add((int[])arr.clone()); return; } for (int i = 0; i < size; i++) { if (used[i]) { continue; } used[i] = true; arr[idx] = i; makePermuration(idx + 1, arr, used, ans, size); used[i] = false; } } }