#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
vector<int> paint;
vector<set<int>> pp;
double sost[1001][1001];
long long getnum(long long num) {
  long long ans = 0;
  long long cou = 1;
  while (cou <= num) {
    if (num > cou * 2) ans += cou;
    if (num >= cou && num < cou * 2) ans += num - cou + 1;
    if (num >= cou && num == cou * 2) ans += num - cou;
    if (cou != 1e18)
      cou *= 10;
    else
      cou++;
  }
  return ans;
}
int main() {
  int n, k;
  cin >> n;
  vector<double> probabilty(n);
  for (int i = 0; i < n; i++) {
    long long l, r;
    cin >> l >> r;
    long long L = getnum(l - 1), R = getnum(r);
    probabilty[i] = double(R - L) / double(r - l + 1);
  }
  cin >> k;
  sost[0][0] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j <= i; j++) {
      sost[i + 1][j] += (1 - probabilty[i]) * sost[i][j];
      sost[i + 1][j + 1] += (probabilty[i]) * sost[i][j];
    }
  double ans = 0.0;
  for (int i = 0; i <= n; i++) {
    if (100 * (i) / n >= k) {
      ans += sost[n][i];
    }
  }
  cout << fixed << setprecision(9) << ans;
  return 0;
}
