#include <bits/stdc++.h>
using namespace std;
long long ones(long long n) {
  if (n == 0) return 0;
  ostringstream os;
  os << n;
  int d = os.str().size() - 1;
  long long res = 0;
  long long t = 1;
  while (d-- > 0) {
    res += t;
    t *= 10LL;
  }
  res += (n / t == 1) ? n % t + 1 : t;
  return res;
}
double dp[1001][1001];
double p[1001];
int main() {
  int n;
  while (cin >> n) {
    long long L, R;
    for (int i = (0); i < ((n)); ++i) {
      cin >> L >> R;
      p[i] = (double)(ones(R) - ones(L - 1)) / (R - L + 1.);
    }
    for (int i = (0); i < ((n + 1)); ++i)
      for (int j = (0); j < ((n + 1)); ++j) dp[i][j] = 0.0;
    dp[0][0] = 1;
    for (int i = (1); i < (n + 1); ++i)
      for (int j = (0); j < ((i + 1)); ++j) {
        dp[i][j] += dp[i - 1][j] * p[i - 1];
        dp[i][j + 1] += dp[i - 1][j] * (1. - p[i - 1]);
      }
    int k;
    cin >> k;
    double res = 0;
    for (int j = (0); j < ((n + 1)); ++j)
      if (k * n <= 100 * (n - j)) res += dp[n][j];
    cout.precision(16);
    cout << res << endl;
  }
  return 0;
}
