#include <bits/stdc++.h>
using namespace std;
const int M = 1004;
long long fun(long long x) {
  long long ans = 0;
  string s = to_string(x);
  if (s[0] == '1') {
    s = s.substr(1);
    for (int i = 0; i < s.size(); i++) ans = ans * 10 + s[i] - '0';
  }
  long long t = 1;
  for (int i = s.size() - 1; i >= 0; i--) {
    ans += t;
    t *= 10;
  }
  return ans;
}
double d[M];
double f[M][M];
int main() {
  int n;
  long long l, r;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> l >> r;
    long long x = fun(r + 1) - fun(l), y = (r - l + 1);
    d[i] = 1.0 * x / y;
  }
  f[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= i; j++) {
      f[i + 1][j] += f[i][j] * (1.0 - d[i + 1]);
      f[i + 1][j + 1] += f[i][j] * d[i + 1];
    }
  }
  int k;
  cin >> k;
  double ans = 0;
  for (int i = 0; i <= n; i++)
    if (100 * i >= n * k) ans += f[n][i];
  printf("%.10f\n", ans);
}
