#include <bits/stdc++.h>
using namespace std;
int n, T, K;
long long pot[19];
double p[1005], t[1005][1005];
long long g(long long x) {
  if (x == 0) return 0;
  if (x <= 9) return 1;
  long long ans = 0;
  for (long long i = 0;; i++) {
    if (i == 19) return ans + 1;
    if (pot[i] > x) return ans;
    long long r = min(x, 2 * pot[i] - 1);
    ans += (r - pot[i] + 1);
    if (r == x) return ans;
  }
  return 0;
}
double f(int x, int k) {
  if (k == T) return 1.0;
  if (x == n) return 0.0;
  double &ret = t[x][k];
  if (ret > -0.5) return ret;
  ret = p[x] * f(x + 1, k + 1) + (1.0 - p[x]) * f(x + 1, k);
  return ret;
}
int main() {
  pot[0] = 1;
  for (int i = 1; i <= 18; i++) pot[i] = pot[i - 1] * 10LL;
  long long a, b;
  cin >> n;
  bool ok = 0;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    long long S = g(b) - g(a - 1);
    p[i] = double(1.0 * S) / double(1.0 * b - a + 1);
    if (S == 0) ok = 1;
  }
  scanf("%d", &K);
  T = (K * n + 99) / 100;
  if (K == 100 && ok)
    printf("%.12lf\n", 0.0);
  else {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < T; j++) t[i][j] = -1.0;
    printf("%.12lf\n", f(0, 0));
  }
}
