#include <bits/stdc++.h>
using namespace std;
double p[1010], dp[1010][1010];
long long pw(long long x) {
  long long rt = 1, ans = 0;
  while (x >= rt << 1) {
    ans += rt;
    rt *= 10;
  }
  ans += max(0ll, x - rt + 1);
  return ans;
}
int main() {
  int n, k;
  long long l, r;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d%I64d", &l, &r);
    p[i] = (double)(pw(r) - pw(l - 1)) / (r - l + 1);
  }
  scanf("%d", &k);
  k = ceil((double)k / 100 * n);
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= n; j++) {
      dp[i][j] += (1 - p[i]) * dp[i - 1][j];
      if (j > 0) dp[i][j] += p[i] * dp[i - 1][j - 1];
    }
  double ans = 0;
  for (; k <= n; k++) ans += dp[n][k];
  printf("%.10lf\n", ans);
}
