import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = sc.nextInt(); } PriorityQueue queue = new PriorityQueue<>(); for (int i = 0; i < n; i++) { queue.add(new Room(arr[i], sc.nextInt())); } double ans = 0; for (int i = 1; i < 1000000; i++) { Room r = queue.poll(); ans += r.getRate() * i; queue.add(r); } System.out.println(ans); } static class Room implements Comparable { double baseRate; double findRate; public Room(double baseRate, double findRate) { this.baseRate = baseRate; this.findRate = findRate; } public Room(int r1, int r2) { this(r1 / 1000.0, r2 / 100.0); } public int compareTo(Room another) { double d1 = getPrivateRate(); double d2 = another.getPrivateRate(); if (d1 == d2) { return 0; } else if (d1 > d2) { return -1; } else { return 1; } } private double getPrivateRate() { return baseRate * findRate; } public double getRate() { double ans = getPrivateRate(); baseRate *= (1 - findRate); return ans; } } }