#include <bits/stdc++.h>
using namespace std;
int n, percent;
double posb[1001];
long long one(long long x) {
  if (x == 0) return 0;
  long long ret = 0;
  for (long long i = 1;; i *= 10) {
    if (x < i) break;
    if (x / 10 >= i)
      ret += i;
    else if (x / i == 1)
      ret += x - i * (x / i) + 1;
    else
      ret += i;
    if (i == 1000000000000000000LL) break;
  }
  return ret;
}
bool done[1001][1001];
double mem[1001][1001];
double dp(int cur, int need) {
  need = max(need, 0);
  if (done[cur][need]) return mem[cur][need];
  if (cur == n + 1) {
    if (need == 0) return 1.0;
    return 0.0;
  }
  mem[cur][need] = 0;
  mem[cur][need] += posb[cur] * dp(cur + 1, need - 1);
  mem[cur][need] += (1.0 - posb[cur]) * dp(cur + 1, need);
  done[cur][need] = true;
  return mem[cur][need];
}
int main() {
  cout << fixed << setprecision(16);
  while (cin >> n) {
    for (int i = 1; i <= n; i++) {
      long long a, b;
      cin >> a >> b;
      a--;
      posb[i] = (double)(one(b) - one(a)) / (double)(b - a);
    }
    int C;
    cin >> C;
    int L = 0;
    while (100 * L < n * C) L++;
    memset(done, false, sizeof(done));
    cout << dp(1, L) << endl;
  }
  return 0;
}
