#include <bits/stdc++.h>
using namespace std;
int kolvo(long long a) {
  int k = 0;
  while (a > 0) {
    a /= 10;
    k++;
  }
  return k;
}
long long powe(long long a, int b) {
  if (b == 1) return a;
  if (b == 0) return 1;
  long long p = powe(a, b / 2);
  p = p * p;
  if (b % 2 == 0) return p;
  return p * a;
}
long long kol(long long l, long long r) {
  long long ans = 0;
  int kl = kolvo(l), kr = kolvo(r);
  long long p = powe(10, kl - 1);
  for (int i = kl; i <= kr; i++) {
    if (l < 2 * p) {
      if (r >= 2 * p)
        ans += 2 * p - l;
      else
        ans += r - l + 1;
    }
    p *= 10;
    l = p;
  }
  return ans;
}
int main() {
  int n;
  long long a, b;
  cin >> n;
  vector<double> p(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a >> b;
    p[i] = 1.0 * kol(a, b) / (b - a + 1.0);
  }
  double k;
  cin >> k;
  vector<vector<double> > d(n + 1, vector<double>(n + 1, 0.0));
  d[0][0] = 1.0;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= i; j++)
      d[i][j] = d[i - 1][j - 1] * p[i] + d[i - 1][j] * (1.0 - p[i]);
  double ans = 0.0;
  for (int j = (int)ceil(n * k / 100.0); j <= n; j++) ans += d[n][j];
  printf("%.9f", ans);
  return 0;
}
