#include <bits/stdc++.h>
using namespace std;
int n, k;
double pr[1000], d[1001], ans = 0;
const double EPS = 1e-20;
long long solve(long long bound) {
  long long ret = 0;
  long long x;
  for (x = 1; x < bound; x *= 10) {
    long long y = x * 2 - 1;
    y = min(y, bound);
    ret += y - x + 1;
  }
  if (x == bound) ++ret;
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < (int)(n); ++i) {
    long long from, to;
    scanf("%I64d%I64d", &from, &to);
    long long cnt = solve(to) - solve(from - 1);
    pr[i] = cnt / double(to - from + 1);
  }
  d[0] = 1;
  for (int i = 0; i < (int)(n); ++i) {
    for (int j = i + 1; j > 0; --j) {
      d[j] += d[j - 1] * pr[i];
      d[j - 1] *= 1 - pr[i];
    }
    for (int j = 0; j < (int)(i + 1); ++j)
      if (d[j] < EPS) {
        d[j] = 0;
      }
  }
  scanf("%d", &k);
  for (int i = 0; i < (int)(n + 1); ++i)
    if (i * 100 >= k * n) {
      ans += d[i];
    }
  printf("%.12f\n", ans);
  return 0;
}
