#include <bits/stdc++.h>
using namespace std;
long long getp(long long x) {
  long long now = 1;
  long long ans = 0;
  while (now <= x) {
    if (now * 2 <= x)
      ans += now;
    else
      ans += x - now + 1;
    if (x / now < 10) break;
    now *= 10;
  }
  return ans;
}
double p[1010], f[1010][1010];
int n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    long long l, r;
    cin >> l >> r;
    p[i] = ((double)(getp(r) - getp(l - 1))) / (r - l + 1);
  }
  f[0][0] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j <= i; j++) {
      f[i + 1][j] += (1 - p[i + 1]) * f[i][j];
      f[i + 1][j + 1] += p[i + 1] * f[i][j];
    }
  int k = 0;
  cin >> k;
  int need = n * k / 100;
  if (n * k % 100) need++;
  double ans = 0;
  for (int i = need; i <= n; i++) ans += f[n][i];
  printf("%.13lf\n", ans);
  return 0;
}
