#include <bits/stdc++.h>
using namespace std;
long long getCount(long long l, long long r) {
  if (l > r) return 0;
  return r - l + 1;
}
long double getProb(long long l, long long r) {
  long long off = 1;
  long long cnt = 0;
  for (int len = 1; off <= r && off >= 0; len++, off *= 10) {
    cnt += getCount(max(l, off), min(r, 2 * off - 1));
  }
  return (long double)cnt / (r - l + 1);
}
int main() {
  int n;
  while (scanf("%d", &n) >= 1) {
    vector<long long> l(n), r(n);
    for (int i = 0; i < n; i++) scanf("%I64d%I64d", &l[i], &r[i]);
    int k;
    scanf("%d", &k);
    vector<vector<long double> > d(n + 1, vector<long double>(n + 1, 0));
    d[0][0] = 1;
    for (int i = 0; i < n; i++) {
      for (int c = 0; c < n; c++) {
        long double prob = getProb(l[i], r[i]);
        fprintf(stderr, "prob=%.10lf\n", (double)prob);
        d[i + 1][c] += d[i][c] * (1 - prob);
        d[i + 1][c + 1] += d[i][c] * prob;
      }
    }
    long double ans = 0;
    for (int i = 0; i <= n; i++)
      if (i * 100.0 / n >= k - 1e-9) {
        ans += d[n][i];
      }
    printf("%.30lf\n", (double)ans);
    break;
  }
  return 0;
}
