#include <bits/stdc++.h>
using namespace std;
int n;
double a[1100][1100];
int main() {
  scanf("%d", &n);
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++) a[i][j] = 0.0;
  a[0][0] = 1.0;
  for (int i = 0; i < n; i++) {
    long long l, r;
    scanf("%I64d%I64d", &l, &r);
    double dd = 1;
    while (dd * 10 <= l) dd *= 10;
    long long sum = 0;
    while (dd <= r) {
      long long d = dd;
      long long d2;
      if (d * 2 - 1 >= l) {
        if (d * 2 - 1 > r)
          d2 = r;
        else
          d2 = d * 2 - 1;
        if (d < l) d = l;
        sum += d2 - d + 1;
      }
      dd *= 10;
    }
    double p = 1.0 * sum / (r - l + 1);
    for (int j = 0; j < n; j++) {
      a[i + 1][j + 1] += a[i][j] * p;
      a[i + 1][j] += a[i][j] * (1 - p);
    }
  }
  double k;
  scanf("%lf", &k);
  k = n * k / 100;
  double res = 0;
  for (int i = n; i >= k; i--) res += a[n][i];
  printf("%0.9lf", res);
  return 0;
}
