#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30, N = 1002;
int ax[] = {0, 1, -1, 0, 0};
int ay[] = {0, 0, 0, -1, 1};
long long calc(long long x) {
  if (x == 0) return 0;
  if (x < 10) return 1;
  long long z = 1, i, nx = 0;
  long long y = x, ans = 1, pow = 10;
  while (y > 9) {
    y /= 10;
    z++;
  }
  for (i = 2; i < z; i++) {
    ans += pow;
    pow *= 10;
  }
  if (y > 1)
    return ans + pow;
  else
    return ans + (x % pow + 1);
}
double dp[1002][1002];
int main() {
  long long l, r, i, n, j;
  double zz[1002], k;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> l >> r;
    zz[i] = ((double)(calc(r) - calc(l - 1))) / ((double)(r - l + 1));
  }
  cin >> k;
  k /= 100;
  dp[0][0] = 1;
  for (i = 1; i <= n; i++) dp[0][i] = 0;
  for (i = 1; i <= n; i++) {
    dp[i][0] = (1 - zz[i]) * dp[i - 1][0];
    for (j = 1; j <= i; j++)
      dp[i][j] = zz[i] * dp[i - 1][j - 1] + (1 - zz[i]) * dp[i - 1][j];
    for (j = i + 1; j <= n; j++) dp[i][j] = 0;
  }
  double ans = 0;
  for (j = 0; j <= n; j++)
    if ((double)j / (double)n >= k) {
      ans += dp[n][j];
    }
  printf("%.9lf", ans);
  return 0;
}
