func_code_string: #include <bits/stdc++.h>   using namespace std;   double dp[5][5005];   double p[5005], subp[5005];   int t[5005];   double qpow(double a, int k) {     double res = 1;     while (k) {       if (k & 1) res *= a;       a *= a;       k >>= 1;     }     return res;   }   int main(int argc, const char* argv[]) {     int n, T;     scanf( %d%d , &n, &T);     for (int i = 1; i <= n; ++i) {       scanf( %lf%d , &p[i], &t[i]);       p[i] /= 100;       subp[i] = 1 - p[i];     }     int cur = 1;     dp[cur ^ 1][0] = 1;     double ans = 0;     for (int i = 1; i <= n; ++i, cur ^= 1) {       double pp = qpow(subp[i], t[i] - 1);       dp[cur][0] = 0;       for (int j = 1; j <= T; ++j) {         double tmp = dp[cur][j - 1];         if (j - 1 >= t[i]) tmp -= dp[cur ^ 1][j - 1 - t[i]] * pp;         tmp *= subp[i];         if (j >= t[i]) tmp += dp[cur ^ 1][j - t[i]] * subp[i] * pp;         tmp += dp[cur ^ 1][j - 1] * p[i];         dp[cur][j] = tmp;         ans += tmp;       }     }     printf( %.10f n , ans);     return 0;   }   