import java.io.File; import java.io.IOException; import java.util.*; public class Main { public static void main(String[] args) throws IOException { //File file = new File("input.txt"); //Scanner sc = new Scanner(file); Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] A = new int[N]; int[] 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(); ArrayList list = new ArrayList(); int[] d = dfs(list, A, B, N); //System.out.println(d[0] + " " + d[1] + " "); System.out.println((1.0 * d[0] / d[1])); } public static int[] dfs(ArrayList cardIndexList, int[] A, int[] B, int N){ int winNum = 0; int battleNum = 0; if(cardIndexList.size() == N){ int count = 0; for(int i = 0; i < N; i++){ //System.out.print(A[cardIndexList.get(i)]); if(A[cardIndexList.get(i)] > B[i]) count++; if(A[cardIndexList.get(i)] < B[i]) count--; } //System.out.println(); battleNum = 1; if(count >= 1) winNum = 1; else winNum = 0; }else{ for(int i = 0; i < N; i++){ if(!cardIndexList.contains(i)){ ArrayList nextList = new ArrayList(); for(Integer m : cardIndexList) nextList.add(m); nextList.add(i); int[] d = dfs(nextList, A, B, N); winNum += d[0]; battleNum += d[1]; } } } int[] d = {winNum, battleNum}; return d; } }