#include <bits/stdc++.h>
using namespace std;
inline int maxx(int a, int b) { return a > b ? a : b; }
inline int minn(int a, int b) { return a < b ? a : b; }
inline void swap(int &a, int &b) {
  int tt = a;
  a = b;
  b = tt;
  return;
}
inline void swap_db(double &a, double &b) {
  double tt = a;
  a = b;
  b = tt;
  return;
}
inline void swap_ll(long long &a, long long &b) {
  long long tt = a;
  a = b;
  b = tt;
  return;
}
int n, k;
double f[1010][1010], ans;
inline double get(double x) {
  double ans = 0, i = 1;
  while (x / 10 >= i) ans += i, i *= 10;
  if (x >= 2 * i)
    ans += i;
  else
    ans += x - i + 1;
  return ans;
}
inline double count() {
  double l, r, a, b;
  scanf("%lf%lf", &l, &r);
  a = get(r) - get(l - 1);
  b = r - l + 1;
  return a / b;
}
int main() {
  int i, j;
  double x;
  scanf("%d", &n);
  for (i = 1, f[0][0] = 1; i <= n; i++) {
    x = count();
    f[i][0] = f[i - 1][0] * (1 - x);
    for (j = 1; j <= i; j++)
      f[i][j] = f[i - 1][j - 1] * x + f[i - 1][j] * (1 - x);
  }
  scanf("%d", &k);
  k = k * n;
  for (i = 0, ans = 0; i <= n; i++)
    if (i * 100 >= k) ans += f[n][i];
  printf("%.11lf\n", ans);
  return 0;
}
