#include <bits/stdc++.h>
using namespace std;
int n, k;
double chance[(1 << 10)];
long long s10[20];
double dp[(1 << 10)][(1 << 10)];
inline void solve() {
  double per = (double)k / 100.;
  int upto = -1;
  for (int i = 0; i <= n; ++i) {
    double now = (double)i / (double)n;
    if (now + (1e-10) > per) {
      upto = i;
      break;
    }
  }
  for (int i = 0; i <= n; ++i) {
    dp[0][i] = 0.;
    dp[i][0] = 1.;
  }
  for (int cur = 1; cur <= n; ++cur)
    for (int used = 1; used <= min(cur, upto); ++used)
      dp[cur][used] = chance[cur] * dp[cur - 1][used - 1] +
                      (1. - chance[cur]) * dp[cur - 1][used];
  cout << setprecision(12) << dp[n][upto];
}
inline void pre() {
  s10[0] = 1LL;
  for (int i = 1; i < 20; ++i) s10[i] = s10[i - 1] * 10LL + 1LL;
}
long long cnt(long long first) {
  if (first == 0LL) return 0LL;
  if (first == 1LL) return 1LL;
  long long save = first, last;
  int br = 0;
  while (first) {
    br++;
    last = first;
    first /= 10;
  }
  if (last == 1LL) return save - s10[br - 1] + s10[br - 2] + s10[br - 2] + 1;
  return s10[br - 1];
}
inline void read() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    long long l, r;
    cin >> l >> r;
    chance[i] = (double)(cnt(r) - cnt(l - 1)) / (double)(r - l + 1);
  }
  cin >> k;
}
int main() {
  pre();
  read();
  solve();
  return 0;
}
