func_code_string: #include <bits/stdc++.h>   using namespace std;   int n;   double p[1001];   double getp(unsigned long long a, unsigned long long b) {     unsigned long long st = 1, ed = 1;     double ret;     while (st < a) st = st * 10;     while (ed < b) ed = ed * 10;     if (ed > b) ed = ed / 10;     if (st > a) st = st / 10;     if (ed + ed - 1 < a) return 0;     if ((ed + ed - 1) <= b) {       ret = st * (pow(10, log10(ed / st) + 1) - 1) / 9;     } else       ret = st * (pow(10, log10(ed / st)) - 1) / 9 + (b - ed + 1);     if (st + st - 1 >= a) ret = ret - (a - st);     if (st + st - 1 < a) ret = ret - (st);     return (double)ret / (b - a + 1);   }   double memo[1001][1001];   double dp(int i, int j) {     if (j < 0 || i < 0) return 0;     if (memo[i][j] != -1) return memo[i][j];     if (i == 0 && j == 0) {       memo[i][j] = 1;       return 1;     }     double ret = p[i - 1] * dp(i - 1, j - 1) + (1 - p[i - 1]) * dp(i - 1, j);     memo[i][j] = ret;     return ret;   }   int main() {     scanf( %d , &n);     for (int i = 0; i <= n; i++) {       for (int j = 0; j <= n; j++) {         memo[i][j] = -1;       }     }     unsigned long long a, b;     int i = 0;     int t = n;     while (t--) {       cin >> a >> b;       p[i++] = getp(a, b);     }     for (int j = 0; j <= n; j++) {       if (memo[n][j] == -1) dp(n, j);     }     double k;     cin >> k;     k = ceil(k * n / 100);     double sum = 0;     for (int j = 0; j <= n; j++) {       if (j >= k) sum = sum + memo[n][j];     }     printf( %.15f , sum);     return 0;   }   