#include <bits/stdc++.h>
using namespace std;
const long double precision = 1e-18;
inline bool lessOrEqual(long double a, long double b) {
  return a - b <= precision;
}
inline bool geraterOrEqual(long double a, long double b) {
  return a - b >= -precision;
}
inline bool equal(long double a, long double b) {
  return abs(a - b) <= precision;
}
long long dp[20][10][2];
string s;
long long n;
long long solve(long long i, long long f, long long t) {
  if (i == n) return f == 1;
  long long &ans = dp[i][f][t];
  if (ans != -1) return ans;
  ans = 0;
  if (t) {
    for (long long d = 0; d < s[i] - '0'; d++)
      ans += solve(i + 1, (f ? f : d), 0);
    ans += solve(i + 1, (f ? f : s[i] - '0'), 1);
  } else {
    for (long long d = 0; d < 10; d++) ans += solve(i + 1, (f ? f : d), 0);
  }
  return ans;
}
long long count(long long num) {
  s = to_string(num), n = s.length();
  memset(dp, -1, sizeof(dp));
  return solve(0, 0, 1);
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long double> dp(n + 1);
  dp[0] = 1;
  for (long long i = 0; i < n; i++) {
    long long l, r;
    cin >> l >> r;
    long double p = (count(r) - count(l - 1));
    p /= (r - l + 1);
    vector<long double> dp2(n + 1);
    for (long long j = 0; j < n; j++) dp2[j + 1] += dp[j] * p;
    for (long long j = 0; j <= n; j++) dp2[j] += dp[j] * (1.00 - p);
    dp = dp2;
  }
  long double k;
  cin >> k;
  long double ans = 0;
  for (long long i = 0; i <= n; i++)
    if (geraterOrEqual(((long double)i) / ((long double)n), k / 100))
      ans += dp[i];
  cout << fixed << setprecision(10) << ans << '\n';
}
