#include <bits/stdc++.h>
long long work(long long x) {
  if (!x) return 0;
  long long res = 0, _10 = 1;
  for (; x / _10; _10 *= 10)
    if (x / _10 > 1)
      res += _10;
    else
      res += x - x / _10 * _10 + 1;
  return res;
}
const int N = 1000 + 10;
int n, k;
double p[N], ans, f[N][N];
int main() {
  scanf("%d", &n);
  for (int i = (int)1, _y = n; i <= _y; i++) {
    long long l, r;
    scanf("%I64d%I64d", &l, &r);
    p[i] = (double)(work(r) - work(l - 1)) / (r - l + 1);
  }
  scanf("%d", &k);
  k = n * k / 100 + (n * k % 100 != 0);
  f[0][0] = 1;
  for (int i = (int)0, _y = n - 1; i <= _y; i++)
    for (int j = (int)0, _y = i; j <= _y; j++)
      f[i + 1][j] += f[i][j] * (1 - p[i + 1]),
          f[i + 1][j + 1] += f[i][j] * p[i + 1];
  for (int i = (int)k, _y = n; i <= _y; i++) ans += f[n][i];
  printf("%.14lf\n", ans);
}
