#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0), eps = 1e-8;
const int inf = ~0U >> 2;
int mod = 1e9 + 7;
int Pow(int x, long long t) {
  int r = 1;
  for (; t; t >>= 1, x = (long long)x * x % mod)
    if (t & 1) r = (long long)r * x % mod;
  return r;
}
const int N = 1010;
int n;
long long l[N], r[N], cnt[N], p10[20];
double p[N];
long long solve(long long x) {
  long long r = 0;
  for (long long i = x, t = 0; i > 0; i /= 10, ++t) {
    if (i == 1)
      r += x - p10[t] + 1;
    else
      r += p10[t];
  }
  return r;
}
double f[N][N];
int main() {
  p10[0] = 1;
  for (int i = 1; i < 20; ++i) p10[i] = p10[i - 1] * 10;
  cin >> n;
  for (int i = 1; i < n + 1; ++i)
    cin >> l[i] >> r[i], cnt[i] = solve(r[i]) - solve(l[i] - 1),
                         p[i] = 1.0 * cnt[i] / (r[i] - l[i] + 1);
  f[0][0] = 1;
  for (int i = 1; i < n + 1; ++i)
    for (int j = 0; j < i + 1; ++j) {
      f[i][j] = f[i - 1][j] * (1 - p[i]);
      if (j) f[i][j] += f[i - 1][j - 1] * p[i];
    }
  double ans = 0;
  int K;
  cin >> K;
  for (int i = 0; i < n + 1; ++i)
    if (i * 100 >= K * n) ans += f[n][i];
  cout << setprecision(20) << ans << endl;
  return 0;
}
