#include <bits/stdc++.h>
using namespace std;
long long n, k;
double dp[1003][1003], p[1003];
double prob(long long l, long long r) {
  long long cnt = (l == 1);
  long long l1 = 1, r1;
  for (int i = 1; i <= 18; i++) {
    l1 *= 10;
    r1 = (l1 * 2) - 1;
    cnt += max(0LL, min(r, r1) - max(l, l1) + 1);
  }
  return (double)cnt / (r - l + 1);
}
int main() {
  int i, j;
  scanf("%lld", &n);
  for (i = 1; i <= n; i++) {
    long long l, r;
    scanf("%lld", &l);
    scanf("%lld", &r);
    p[i] = prob(l, r);
  }
  scanf("%lld", &k);
  dp[0][0] = 1.0;
  for (i = 1; i <= n; i++) {
    dp[i][0] = dp[i - 1][0] * (1 - p[i]);
    for (j = 1; j <= i; j++)
      dp[i][j] = dp[i - 1][j] * (1 - p[i]) + dp[i - 1][j - 1] * p[i];
  }
  k = ceil(n * ((double)k / 100.0));
  double ans = 0.0;
  for (j = k; j <= n; j++) ans += dp[n][j];
  printf("%.10f\n", ans);
  return 0;
}
