#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 1;
inline long long input(void) {
  char t;
  long long x = 0;
  int neg = 0;
  t = getchar();
  while ((t < 48 || t > 57) && t != '-') t = getchar();
  if (t == '-') {
    neg = 1;
    t = getchar();
  }
  while (t >= 48 && t <= 57) {
    x = (x << 3) + (x << 1) + t - 48;
    t = getchar();
  }
  if (neg) x = -x;
  return x;
}
inline void output(long long x) {
  char a[20];
  int i = 0, j;
  a[0] = '0';
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x == 0) putchar('0');
  while (x) {
    a[i++] = x % 10 + 48;
    x /= 10;
  }
  for (j = i - 1; j >= 0; j--) {
    putchar(a[j]);
  }
  putchar('\n');
}
long double dp[1010][1010], p[1010], ans = 0.0;
int main() {
  long long n, l, r, x, sz, k;
  n = input();
  for (int i = 0; i < n; ++i) {
    l = input();
    r = input();
    x = 1;
    sz = 0;
    for (int j = 0; j < 19; ++j) {
      if (l <= x && r >= 2 * x - 1)
        sz += x;
      else if (l <= x && r >= x)
        sz += (r - x + 1);
      else if (l >= x && l <= 2 * x - 1 && r >= 2 * x - 1)
        sz += (2 * x - l);
      else if (l >= x && l <= 2 * x - 1 && r <= 2 * x - 1)
        sz += (r - l + 1);
      x *= 10;
      if (sz < 0) output(sz);
    }
    p[i] = (1.0 * sz) / ((r - l + 1) * 1.0);
  }
  k = input();
  for (int i = 0; i < n; ++i) {
    if (i == 0) {
      dp[i][i] = 1.0 - p[i];
      dp[i][i + 1] = p[i];
      continue;
    }
    for (int j = 0; j < i + 2; ++j) {
      dp[i][j] += p[i] * dp[i - 1][j - 1];
      dp[i][j] += (1.0 - p[i]) * dp[i - 1][j];
    }
  }
  for (int i = 0; i < n + 1; ++i)
    if (100 * i >= k * n) ans += dp[n - 1][i];
  printf("%.9lf\n", (double)ans);
  return 0;
}
