#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long double dp[1001][1001];
long double p[1001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(15);
  int N, k;
  unsigned long long l, r;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> l >> r;
    unsigned long long cur = 0;
    for (unsigned long long j = 1; j <= r; j *= 10) {
      long long st = max(j, l);
      long long en = min(r, 2 * j - 1);
      if (st <= en) cur += en - st + 1;
    }
    p[i] = 1. * cur / (r - l + 1);
  }
  cin >> k;
  dp[0][0] = 1;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j <= i; j++) {
      dp[i + 1][j] += dp[i][j] * (1. - p[i]);
      dp[i + 1][j + 1] += dp[i][j] * p[i];
    }
  }
  long double res = 0.;
  for (int i = 0; i <= N; i++) {
    if (i * 100 >= k * N) res += dp[N][i];
  }
  cout << res << '\n';
  return 0;
}
