Problem: Given n integers a1, a2,…, an and n integers p1, p2,…, pn, integer m. The operation of selecting the kth integer ak with a probability of pk [%] is performed for each k (1 ≤ k ≤ n), and 0 or more and n or less integers are selected. Find the expected number of integers between 1 and m that are divisible by at least one of the selected integers.

Constraints

* 1 ≤ n ≤ 20

* 1 ≤ m ≤ 1018

* 1 ≤ ak ≤ 1018 (1 ≤ k ≤ n)

* 1 ≤ pk ≤ 99 (1 ≤ k ≤ n)

Input

The input is given in the following format.

> n m
> a1 a2… an
> p1 p2… pn
>

Output

Print the solution to the problem on one line. The output must not have an absolute or relative error of more than 0.0000001 (= 10-7).

Examples

Input

2 15
3 5
50 50


Output

3.75


Input

4 100
2 3 5 7
80 60 40 20


Output

57.352


Input

4 210
2 3 5 7
80 60 40 20


Output

119.9136

Solution (in CPP):

Solution:
// includes
#include <bits/stdc++.h>

// macros
#define ll long long int
#define pb emplace_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for(int i=((int)(n)-1);i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define FI first
#define SE second
using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
typedef pair<double, double> Pd;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;
const int mod = 1e9 + 7;

// solve
template <class T>bool chmax(T &a, const T &b){if(a < b){a = b; return 1;} return 0;}
template <class T>bool chmin(T &a, const T &b){if(a > b){a = b; return 1;} return 0;}
template <typename T> istream &operator>>(istream &is, vector<T> &vec){for(auto &v: vec)is >> v; return is;}

/*
 * f(U) = \sum_{U\in T}(-1)^(|T\U|)f(T)
 * for f(U) = \sum_{U\in T}f(T), use f[j | i] -= f[j];
 */
template <typename T>
void fast_moebius(vector<T> &f){
  int n = f.size();
  for(int i = 1; i < n; i<<=1){
    for(int j = 0; j < n; j++){
      if((j & i) == 0){
        f[j | i] -= f[j];
      }
    }
  }
}

ostream& operator<<(ostream& dest, __int128_t value) {
  ostream::sentry s(dest);
  if(s){
    __uint128_t tmp = value < 0 ? - value: value;
    char buf[128];
    char *d = end(buf);
    do{
      --d;
      *d = "0123456789"[tmp % 10];
      tmp /= 10;
    }while(tmp != 0);
    if(value < 0)--d, *d='-';
    int len = end(buf) - d;
    if(dest.rdbuf()->sputn(d, len) != len){
      dest.setstate(ios_base::badbit);
    }
  }
  return dest;
}

__int128_t to_int128(string s){
  __int128_t res = 0;
  for(int i = 0; i < s.size(); i++){
    res = res * 10 + (s[i] - '0');
  }
  return res;
}

using uint128 = __int128_t;

template<typename T>
T gcd(T a, T b) {
  if(a > b)return gcd(b, a);
  if(a == 0)return b;
  return gcd(b % a, a);
}

int main(int argc, char const* argv[])
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  ll m;
  cin >> n >> m;
  vector<ll> a(n);
  vector<int> p(n);
  cin >> a >> p;
  double res = 0.;
  vector<ll> f((1 << n), 0);
  vector<double> pr((1 << n), 0.);
  for(int i = 0; i < (1 << n); i++){
    uint128 tmp = 1;
    double ptmp = 1.;
    bool ng = false;
    if(tmp > m){
      ng = true;
      tmp = m + 1;
    }
    for(int j = 0; j < n; j++){
      if((i >> j) % 2 == 1){
        if(!ng)tmp = tmp * (a[j] / gcd(tmp, uint128(a[j])));
        if(tmp > m){
          ng = true;
          tmp = m + 1;
        }
        ptmp *= (double)p[j] / 100.;
      }else ptmp *= (1. - (double)p[j] / 100.);
    }
    if(i == 0)tmp = m + 1;
    if(ng)tmp = m + 1;
    f[i] = (tmp > 0 ? m / tmp: 0);
    pr[i] = ptmp;
  }
  fast_moebius(f);
  //for(int i = 0; i < (1 << n); i++)cout << i << " " << f[i] << endl;
  for(int i = 0; i < (1 << n); i++)res += pr[i] * (double)(abs(f[i]));
  cout << setprecision(20);
  cout << res << endl;
	return 0;
}