import java.util.Scanner; class Main { static int n; static int[] b; static int[] a; static long win = 0; public static void main(String[] args) { Scanner sc = new Scanner(System.in); n = sc.nextInt(); a = new int[n]; b = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); } for (int i = 0; i < n; i++) { b[i] = sc.nextInt(); } boolean used[] = new boolean[n]; int[] tmp = new int[n]; long battlenum[] = new long[n + 10]; battlenum[0] = 1; battlenum[1] = 1; for (int i = 2; i < 10; i++) { battlenum[i] = i * battlenum[i - 1]; } permutation(a, tmp, used, 0); System.out.println(win * 1.0 / battlenum[n]); sc.close(); } public static void permutation(int[] origin, int[] tmp, boolean[] used, int index) { if (index == n) { // 処理 Battle(tmp); return; } for (int i = 0; i < n; i++) { if (used[i]) continue; tmp[index] = origin[i]; used[i] = true; permutation(origin, tmp, used, index + 1); used[i] = false; } } public static void Battle(int[] op) { int cnt = 0; for (int i = 0; i < n; i++) { if (op[i] > b[i]) { cnt++; } } if (cnt > n / 2) { win++; } } }