#include <bits/stdc++.h>
using namespace std;
int digits(long long int a) {
  int f = 0;
  while (a > 0) {
    a = a / 10;
    f++;
  }
  return f;
}
double dp[1001][1001] = {0};
int main() {
  int n;
  cin >> n;
  vector<long long int> V;
  V.push_back(1);
  V.push_back(1);
  long long int a = 1;
  for (int i = 2; i <= 19; ++i) {
    a = a * 10;
    V.push_back(a);
    V.push_back(2 * a - 1);
  }
  long long int L[n + 1];
  long long int R[n + 1];
  for (int i = 1; i <= n; ++i) {
    cin >> L[i] >> R[i];
  }
  int k;
  cin >> k;
  double d[1001] = {0};
  for (int i = 1; i <= n; ++i) {
    int a = digits(L[i]);
    int b = digits(R[i]);
    long long int ans = 0;
    if (a < b) {
      for (int j = a + 1; j < b; ++j) {
        ans += (V[2 * j - 1] - V[2 * j - 2] + 1);
      }
      if (L[i] >= V[2 * a - 2] && L[i] <= V[2 * a - 1]) {
        ans += (V[2 * a - 1] - L[i] + 1);
      } else if (L[i] < V[2 * a - 2]) {
        ans += (V[2 * a - 1] - V[2 * a - 2] + 1);
      }
      if (R[i] > V[2 * b - 1])
        ans += (V[2 * b - 1] - V[2 * b - 2] + 1);
      else if (R[i] <= V[2 * b - 1] && R[i] >= V[2 * b - 2])
        ans += (R[i] - V[2 * b - 2] + 1);
    } else {
      if (L[i] >= V[2 * a - 2] && L[i] <= V[2 * a - 1] &&
          R[i] >= V[2 * a - 2] && R[i] <= V[2 * a - 1])
        ans += (R[i] - L[i] + 1);
      else if (L[i] >= V[2 * a - 2] && L[i] <= V[2 * a - 1]) {
        ans += (V[2 * a - 1] - L[i] + 1);
      } else if (R[i] >= V[2 * a - 2] && R[i] <= V[2 * a - 1]) {
        ans += (R[i] - V[2 * a - 2] + 1);
      } else if (L[i] < V[2 * a - 2] && R[i] > V[2 * a - 1]) {
        ans += (V[2 * a - 1] - V[2 * a - 2] + 1);
      }
    }
    d[i] = 1.0 * ans;
    d[i] = 1.0 * d[i] / (R[i] - L[i] + 1);
  }
  dp[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= i; ++j) {
      dp[i][j] = 1.0 * dp[i - 1][j] * (1.0 - d[i]);
      if (j > 0) dp[i][j] += (1.0 * dp[i - 1][j - 1] * 1.0 * d[i]);
    }
  }
  double ans = 1.0 * k / 100;
  ans = 1.0 * ans * n;
  ans = ceil(ans);
  double sum = 0;
  for (int i = (int)ans; i <= n; ++i) sum += dp[n][i];
  printf("%.10f\n", sum);
  return 0;
}
