#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1000;
const int MAX_B = 19;
long long ets[MAX_B], gds[MAX_B];
long double ps[MAX_N], dp[MAX_N + 1][MAX_N + 1];
long long calc_good(long long n) {
  for (int b = MAX_B - 1; b >= 0; b--)
    if (ets[b] <= n) {
      int d = n / ets[b];
      if (d == 1) return n - ets[b] + gds[b];
      return ets[b] + gds[b];
    }
  return 0;
}
int main() {
  ets[0] = 1;
  for (int i = 1; i < MAX_B; i++) {
    ets[i] = ets[i - 1] * 10;
    gds[i] = gds[i - 1] + ets[i - 1];
  }
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    long long l, r;
    scanf("%lld%lld", &l, &r);
    r++;
    ps[i] = (long double)(calc_good(r) - calc_good(l)) / (r - l);
  }
  int k;
  scanf("%d", &k);
  dp[0][0] = 1.0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j <= i; j++) {
      dp[i + 1][j] += dp[i][j] * (1.0 - ps[i]);
      dp[i + 1][j + 1] += dp[i][j] * ps[i];
    }
  int m = (n * k + 99) / 100;
  long double sum = 0.0;
  for (int i = m; i <= n; i++) sum += dp[n][i];
  printf("%.15Lf\n", sum);
  return 0;
}
