#include <bits/stdc++.h>
using namespace std;
long long INF = (1ll << 61);
using namespace std;
vector<vector<long long>> a;
long long n;
long long helper(long long x) {
  if (x <= 0) return 0;
  long long val = 1, val1 = 1;
  long long ans = 0;
  long long cnt = 0;
  while (val <= x) {
    ans += val1;
    val1 *= 10;
    val = val * 10 + 9;
  }
  if (val1 <= x) {
    ans += x - val1 + 1;
  }
  return ans;
}
long long getNumOnesInllervals(long long l, long long r) {
  return helper(r) - helper(l - 1);
}
double dp[1001][1001];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  a.resize(n);
  for (long long i = 0; i < n; i++) {
    long long l, r;
    cin >> l >> r;
    a[i] = {r - l + 1, getNumOnesInllervals(l, r)};
  }
  long long k;
  cin >> k;
  if (k == 0) {
    cout << 1;
    return 0;
  }
  dp[0][1] = (a[0][1] / (a[0][0] + 0.0));
  dp[0][0] = 1.0 - dp[0][1];
  for (long long i = 1; i < n; i++) {
    double p = (a[i][1] / (a[i][0] + 0.0));
    for (long long j = 0; j <= i + 1; j++) {
      if (j == 0)
        dp[i][j] = dp[i - 1][j] * (1 - p);
      else {
        dp[i][j] = dp[i - 1][j] * (1.0 - p) + dp[i - 1][j - 1] * p;
      }
    }
  }
  double ans = 0;
  long long cnt = 0;
  for (; cnt < n; cnt++) {
    double per = ((cnt + 1.0) / n);
    if (per * 100 - k < 0) continue;
    break;
  }
  cnt++;
  for (int j = cnt; j <= n; j++) {
    ans += dp[n - 1][j];
  }
  cout << setprecision(20) << ans << "\n";
}
