#include <bits/stdc++.h>
using namespace std;
const int inf = 1000 * 1000 * 1000;
int n, C;
long long L[1024], R[1024];
double K, v[1024];
double dp[1024][1024];
char b[1024][1024];
double DP(int pos, int d) {
  if (pos == n && d >= C) return 1;
  if (pos == n) return 0;
  if (b[pos][d]) return dp[pos][d];
  double &res = dp[pos][d];
  res = DP(pos + 1, d + 1) * v[pos] + DP(pos + 1, d) * (1 - v[pos]);
  b[pos][d] = 1;
  return res;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> L[i] >> R[i];
    R[i]++;
  }
  cin >> K;
  K /= 100;
  for (int i = 0; i < n; i++) {
    long long t = 1, res = 0;
    for (int j = 0; j < 19; j++) {
      long long tL = max(L[i], t), tR = min(R[i], t * 2);
      res += max(0ll, tR - tL);
      t *= 10;
    }
    v[i] = res / (R[i] - L[i] + 0.0);
  }
  for (int i = 0; i <= n; i++) {
    if (i / (n + 0.0) + 1e-9 >= K) {
      C = i;
      break;
    }
  }
  printf("%.10lf\n", DP(0, 0));
  return 0;
}
