#include <bits/stdc++.h>
using namespace std;
const int N = 1001;
long double dp[N][N];
long long calc(long long a) {
  if (!a) return 0;
  long long res = 1, cur = 10;
  while (a >= cur && cur < 1e18) {
    res += min(a - cur + 1, cur);
    cur *= 10;
  }
  return res + (long long)(a == 1e18);
}
int main() {
  int n, k;
  cin >> n;
  vector<pair<long long, long long> > v(n);
  for (auto& t : v) cin >> t.first >> t.second;
  cin >> k;
  vector<long double> p(n);
  for (int i = 0; i < n; i++) {
    long long l = v[i].first, r = v[i].second;
    p[i] = (long double)1 * (calc(r) - calc(l - 1)) / (r - l + 1);
  }
  p.insert(p.begin(), 0);
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= i; j++) {
      dp[i][j] += (1 - p[i]) * dp[i - 1][j];
      if (j) dp[i][j] += p[i] * dp[i - 1][j - 1];
    }
  }
  long double ans = 0;
  for (int i = 0; i <= n; i++) {
    if (100 * i >= k * n) ans += dp[n][i];
  }
  cout << fixed << setprecision(15) << ans << endl;
}
