#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios::sync_with_stdio(0);
  solve();
  return 0;
}
long long pw[19];
stringstream dbg;
int LG(long long n) {
  for (int i = 0; i < 19; i++) {
    if (pw[i] == n) return i;
    if (pw[i] > n) return i - 1;
  }
  cout << dbg.str() << endl;
  exit(0);
}
long long getCnt(long long L, long long R) {
  int f = LG(L), t = LG(R);
  long long A = pw[f], B = pw[t];
  long long ans = 0;
  if (L <= 2 * A) {
    ans += min(2 * A, R + 1) - L;
  }
  if (A == B) return ans;
  if (R < 2 * B) {
    ans += R - B + 1;
  } else {
    ans += B;
  }
  for (int i = f + 1; i < t; i++) ans += pw[i];
  return ans;
}
void solve() {
  pw[0] = 1;
  for (int i = 1; i <= 18; i++) pw[i] = 10 * pw[i - 1];
  static long double p[1100];
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    long long L, R;
    dbg.clear();
    cin >> L >> R;
    dbg << L << ' ' << R;
    long long cnt0 = (R - L + 1);
    long long cnt1 = getCnt(L, R);
    p[i] = (long double)cnt1 / (long double)cnt0;
  }
  int P;
  cin >> P;
  int K = N * P / 100;
  if (P > 0 && 100 * K / P < N) K++;
  static long double dp[2][1101];
  long double* cur = dp[0];
  long double* nxt = dp[1];
  cur[0] = 1.0 - p[0];
  cur[1] = p[0];
  for (int i = 1; i < N; i++) {
    nxt[0] = cur[0] * (1.0 - p[i]);
    for (int k = 1; k <= N; k++) {
      nxt[k] = cur[k - 1] * p[i] + cur[k] * (1.0 - p[i]);
    }
    swap(cur, nxt);
  }
  long double s = 0.0;
  for (int i = K; i <= N; i++) s += cur[i];
  cout.precision(15);
  cout << fixed << s << '\n';
}
