#include <bits/stdc++.h>
using namespace std;
int r[202], m[202];
bool vis[100000];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> m[i];
  for (int i = 0; i < n; ++i) cin >> r[i];
  for (int i = 0; i < n; ++i) {
    for (int j = r[i]; j < 100000; j += m[i]) {
      vis[j] = true;
    }
  }
  int ans = 0;
  for (int i = 0; i < 100000; ++i)
    if (vis[i]) ++ans;
  cout << fixed << setprecision(10) << (double)ans / 100000 << endl;
}
