#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long count(long long num) {
  long long ans = 0, sum = num, cnt = 0, hest = 0;
  while (sum) {
    hest = sum % 10;
    sum /= 10;
    cnt++;
  }
  cnt--;
  long long k = 1;
  for (long long i = 1; i <= cnt; i++) {
    ans += k;
    k *= 10;
  }
  if (hest > 1) {
    ans += k;
  } else {
    ans += num - k + 1;
  }
  return ans;
}
double pro(long long l, long long r) {
  double ans = 0;
  ans = ((double)(count(r) - count(l - 1))) / ((double)(r - l + 1));
  return ans;
}
long long l, r;
double p[1005];
double dp[1005][1005];
int main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld%lld", &l, &r);
    p[i] = pro(l, r);
  }
  scanf("%lld", &k);
  dp[0][0] = 1;
  for (long long j = 1; j <= n; j++) {
    dp[0][j] = dp[0][j - 1] * (1.0 - p[j]);
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      dp[i][j] = dp[i - 1][j - 1] * p[j] + dp[i][j - 1] * (1 - p[j]);
    }
  }
  double ans = 0;
  for (long long i = (long long)(n * k / 100.0 + 0.999); i <= n; i++) {
    ans += dp[i][n];
  }
  printf("%.10lf", ans);
  return 0;
}
