#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long A = 200005;
const long long mod = 1000000007;
bool comp(long long a, long long b) { return a > b; }
long long n, k, tt = 1;
istream& operator>>(istream& in, pair<long long, long long>& p) {
  in >> p.first >> p.second;
  return in;
}
ostream& operator<<(ostream& out, pair<long long, long long> p) {
  cout << "printing pair"
       << "\n";
  out << p.first << " " << p.second << "\n";
  return out;
}
long long count1(long long p) {
  long long num = 0;
  long long cnt = 0;
  while (num < 1e18 && num * 10 + 9 <= p) {
    cnt *= 10;
    cnt++;
    num = num * 10 + 9;
  }
  if (p - num <= (num + 1)) {
    cnt += (p - num);
  } else {
    cnt *= 10;
    cnt++;
  }
  return cnt;
}
long double findp1(long long a, long long b) {
  long double probability = (count1(b) - count1(a - 1));
  probability /= (b - a + 1);
  return probability;
}
void solve() {
  cin >> n;
  std::vector<long double> p1(n + 1);
  for (long long i = 0; i < n; i++) {
    pair<long long, long long> p;
    cin >> p;
    p1[i + 1] = findp1(p.first, p.second);
  }
  cin >> k;
  vector<vector<long double> > dp(n + 1, vector<long double>(n + 1, 0));
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = (dp[i - 1][0] * (1 - p1[i]));
    for (long long z = 1; z <= i; z++) {
      dp[i][z] = dp[i - 1][z] * (1 - p1[i]) + dp[i - 1][z - 1] * (p1[i]);
    }
  }
  long double ans = 0;
  for (int i = 0; i <= n; i++) {
    if ((i * 100) / n < k) {
      ans += (dp[n][i]);
    } else
      break;
  }
  cout << (1 - ans) << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  long long t = 1;
  cout << fixed << showpoint;
  cout << setprecision(12);
  while (t--) {
    solve();
  }
  return 0;
}
