#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1005;
int n, m;
long long l[MAXN], r[MAXN];
long double g[MAXN], f[MAXN][MAXN];
inline long long read() {
  long long x = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x;
}
inline void init() {
  n = read();
  for (int i = 1; i <= n; i++) l[i] = read(), r[i] = read();
  m = read();
}
inline void prepare() {
  for (int i = 1; i <= n; i++) {
    int flag = 0;
    long long tmp1 = 1, tmp2 = 2, tot = 0;
    for (int j = 0; j <= 18; j++) {
      if (tmp1 <= l[i] && tmp2 > r[i]) {
        tot = r[i] - l[i] + 1;
        break;
      }
      if (tmp1 > r[i]) break;
      if (tmp2 > r[i]) {
        tot += r[i] - tmp1 + 1;
        break;
      }
      if (flag) tot += tmp2 - tmp1;
      if (tmp2 > l[i] && !flag) flag = 1, tot += tmp2 - max(tmp1, l[i]);
      tmp1 *= 10, tmp2 *= 10;
    }
    g[i] = (long double)tot / (r[i] - l[i] + 1);
  }
}
inline void solve() {
  f[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i][0] = f[i - 1][0] * (1 - g[i]);
    for (int j = 1; j <= i; j++)
      f[i][j] = f[i - 1][j - 1] * g[i] + f[i - 1][j] * (1 - g[i]);
  }
  long double ans = 0;
  for (int i = 0; i <= n; i++)
    if (i * 100 >= n * m) ans += f[n][i];
  cout << fixed << setprecision(15) << ans << endl;
}
int main() {
  init();
  prepare();
  solve();
  return 0;
}
