#include <bits/stdc++.h>
using namespace std;
const int maxn = 1003;
double p[maxn], dp[maxn][maxn];
long long cal(long long n) {
  long long tmp = n, ans = 0, cnt = 0, num = 1, head = 0;
  if (!tmp) return 0;
  while (tmp) {
    head = tmp % 10;
    tmp /= 10;
    cnt++;
  }
  for (int i = 1; i < cnt; i++) {
    ans += num;
    num *= 10;
  }
  if (head > 1)
    return ans + num;
  else if (head == 1)
    return ans + n - num + 1;
}
int main() {
  int n, k;
  long long l, r;
  double ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d%I64d", &l, &r);
    p[i] = double(cal(r) - cal(l - 1)) / (1.0 * ((r - l + 1)));
  }
  scanf("%d", &k);
  dp[0][0] = 1.0;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= i; j++)
      if (!j)
        dp[i][j] = (1.0 - p[i]) * dp[i - 1][j];
      else
        dp[i][j] = p[i] * dp[i - 1][j - 1] + (1.0 - p[i]) * dp[i - 1][j];
  for (int i = 0; i <= n; i++)
    if (k * n <= i * 100) ans += dp[n][i];
  printf("%.10lf", ans);
  return 0;
}
