#include <bits/stdc++.h>
long long MOD = 1000000007;
long long inf = 1e18;
using namespace std;
long long n;
double Mem[1005][1005];
double P[1005];
double Solve(long long i, long long cur) {
  if (i == n) {
    if (cur > 0) {
      return 0;
    }
    return 1.0;
  }
  if (cur <= 0) {
    return 1.0;
  }
  if (Mem[i][cur] > -1) {
    return Mem[i][cur];
  }
  double ans = P[i] * Solve(i + 1, cur - 1) + (1 - P[i]) * Solve(i + 1, cur);
  Mem[i][cur] = ans;
  return ans;
}
long long T[100];
double Ones(long long x, long long y) {
  long long lx = 0, ly = 0;
  long long xx, yy;
  long long dx, dy;
  xx = x;
  yy = y;
  long long i;
  while (xx != 0) {
    dx = xx % 10;
    xx /= 10;
    lx++;
  }
  while (yy != 0) {
    dy = yy % 10;
    yy /= 10;
    ly++;
  }
  long long ans = 0;
  if (lx == ly) {
    if (dx != 1) {
      return 0;
    }
    if (dy == 1) {
      return y - x + 1;
    }
    return T[lx - 1] - x;
  } else {
    if (dx == 1) {
      ans += T[lx - 1] - x;
    }
    if (dy == 1) {
      ans += y - T[ly - 1] / 2 + 1;
    } else {
      ans += T[ly - 1] - T[ly - 1] / 2;
    }
    for (i = lx + 1; i < ly; i++) {
      ans += T[i - 1] - T[i - 1] / 2;
    }
    return ans;
  }
}
int main() {
  ios::sync_with_stdio(0);
  long long i, x, y, cur = 0;
  long long k, j;
  cin >> n;
  long long p = 2;
  for (i = 0; i < 20; i++) {
    T[i] = p;
    p *= 10;
  }
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    P[i] = Ones(x, y) / (y - x + 1);
  }
  cin >> k;
  for (i = 0; i < 1005; i++) {
    for (j = 0; j < 1005; j++) {
      Mem[i][j] = -2;
    }
  }
  cur = (n * k) / 100;
  while (cur * 100 < n * k) {
    cur++;
  }
  cout.precision(20);
  cout << Solve(0, cur) << '\n';
  return 0;
}
