#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long mx = 200009;
void yes() { cout << "Yes" << '\n'; }
void no() { cout << "No" << '\n'; }
double pro[mx];
long long l[mx], r[mx];
double dp[1009][1009];
int main() {
  long long n;
  cin >> n;
  l[0] = r[0] = 1;
  for (long long i = 1; i <= 18; i++) {
    l[i] = l[i - 1] * 10;
    r[i] = r[i - 1] * 10 + 9;
  }
  for (long long i = 1; i <= n; i++) {
    long long a, b;
    cin >> a >> b;
    long long tot = 0;
    for (long long j = 0; j <= 18; j++) {
      long long d = min(r[j], b);
      long long e = max(a, l[j]);
      if (d >= e) tot += d - e + 1;
    }
    pro[i] = tot / (double)(b - a + 1);
  }
  dp[0][0] = 1.0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= i; j++) {
      if (j == 0)
        dp[i][j] = (1 - pro[i]) * dp[i - 1][j];
      else
        dp[i][j] = pro[i] * (dp[i - 1][j - 1]) + (1 - pro[i]) * dp[i - 1][j];
    }
  }
  int k;
  cin >> k;
  double ans = 0.0;
  for (int i = 0; i <= n; i++) {
    if (i * 100 >= k * n) ans += dp[n][i];
  }
  cout << fixed << setprecision(10) << ans << '\n';
}
