import java.util.ArrayDeque; import java.util.Deque; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { private static int n; private static int[] a; private static int[] b; private static int win = 0; private static int match = 0; private static void make(Deque que) { if(que.size() == n) { match++; int awin = 0; int bwin = 0; for(int i = 0; i < n; i++) { int j = que.poll(); if(a[i] > b[j]) awin++; else bwin++; } if(awin > bwin) win++; return; } for(int i = 0; i < n; i++) { if(!que.contains(i)) { Deque nque = new ArrayDeque<>(); for(int j : que) { nque.add(j); } nque.add(i); make(nque); } } } 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(); } make(new ArrayDeque<>()); System.out.println(1.0 * win / match); sc.close(); } }