#include <bits/stdc++.h>   using namespace std;   template <class T>   bool umin(T& a, T b) {     if (a > b) {       a = b;       return 1;     }     return 0;   }   template <class T>   bool umax(T& a, T b) {     if (a < b) {       a = b;       return 1;     }     return 0;   }   const int N = 1e3 + 9;   double dp[N][N], prob[N];   bool vis[N][N];   long long sum[22], pw[22];   double rec(int x, int y) {     umax(y, 0);     if (!x) {       if (!y) return 1.0;       return 0.0;     }     double& ret = dp[x][y];     if (vis[x][y]) return ret;     vis[x][y] = 1;     return ret = rec(x - 1, y - 1) * prob[x] + rec(x - 1, y) * (1 - prob[x]);   }   long long f(long long x) {     if (!x) return 0;     vector<int> v;     while (x >= 1) {       v.push_back(x % 10);       x /= 10;     }     reverse(v.begin(), v.end());     if (v[0] > 1) return sum[v.size()];     long long res = sum[v.size() - 1];     for (int i = 1; i < int(v.size()); i++) {       if (v[i] == 0) continue;       res += (v[i]) * 1LL * pw[v.size() - i - 1];     }     return res + 1;   }   int main() {     pw[0] = 1;     for (int i = 1; i <= 18; i++) {       pw[i] = pw[i - 1] * 10;       sum[i] = sum[i - 1] + pw[i - 1];     }     int n, k;     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       long long x, y;       scanf( %lld%lld , &x, &y);       long long res = f(y) - f(x - 1);       prob[i] = double(res) / double(y - x + 1);     }     scanf( %d , &k);     printf( %.12lf n , rec(n, (k * n + 99) / 100));     return 0;   }   