#include <bits/stdc++.h>
using namespace std;
string tos(long long n) {
  stringstream os;
  os << n;
  return os.str();
}
long long good[1005], total[1005];
string s;
long long memo[20][2][2];
long long g(int p, bool with1, bool menor) {
  long long &x = memo[p][with1][menor];
  if (x != -1)
    return x;
  else if (p == s.size())
    return x = with1;
  else {
    if (with1) {
      char d1 = '0';
      char d2 = (menor ? '9' : s[p]);
      x = 0;
      for (char d = d1; d <= d2; d++) x += g(p + 1, with1, menor || d < s[p]);
      return x;
    } else {
      x = g(p + 1, 0, menor || '0' < s[p]);
      x += g(p + 1, 1, menor || '1' < s[p]);
      return x;
    }
  }
}
long long f(unsigned long long N) {
  if (N <= 0) return 0;
  unsigned long long pot10 = 1, cnt = 0;
  while (pot10 <= N) {
    cnt += min(2 * pot10 - 1, N) - pot10 + 1;
    pot10 *= 10;
  }
  return cnt;
  s = tos(N);
  memset(memo, -1, sizeof(memo));
  return g(0, 0, 0);
}
long double dp[1005][1005];
int main() {
  int n;
  while (cin >> n) {
    for (int i = 0; i < n; i++) {
      long long L, R;
      cin >> L >> R;
      good[i] = f(R) - f(L - 1);
      total[i] = R - L + 1;
    }
    int k;
    cin >> k;
    int minN = (k == 0 ? 0 : (k * n - 1) / 100 + 1);
    for (int p = n; p >= 0; p--) {
      for (k = 0; k <= n; k++) {
        if (k == 0)
          dp[p][k] = 1.0;
        else if (p == n)
          dp[p][k] = 0.0;
        else {
          dp[p][k] =
              good[p] * dp[p + 1][k - 1] + (total[p] - good[p]) * dp[p + 1][k];
          dp[p][k] /= total[p];
        }
      }
    }
    printf("%.15lf\n", (double)dp[0][minN]);
  }
  return 0;
}
