func_code_string: #include <bits/stdc++.h>   using namespace std;   inline int read() {     int x = 0, f = 1;     char ch = getchar();     for (; !isdigit(ch); ch = getchar()) {       if (ch ==  - ) f = -1;     }     for (; isdigit(ch); ch = getchar()) {       x = x * 10 + ch - 48;     }     return x * f;   }   const int mxN = 1e5;   const int P = 998244353;   struct Element {     long long x, v, p;   } a[mxN + 3];   struct Event {     int u, x, y;     long long t1, t2;     bool operator<(const Event &arg) const { return t1 * arg.t2 < t2 * arg.t1; }   } ev[mxN * 2 + 3];   int f[mxN + 3][2][2];   int n, m;   long long quickpow(long long x, long long y) {     long long cur = x, ret = 1ll;     for (int i = 0; y; i++) {       if (y & (1ll << i)) {         y -= (1ll << i);         ret = ret * cur % P;       }       cur = cur * cur % P;     }     return ret;   }   long long mulinv(long long x) { return quickpow(x, P - 2); }   struct SgTNode {     long long x[2][2];   } sgt[mxN * 4 + 3];   void pushup(int u, int mid) {     for (int i = 0; i < 2; i++)       for (int j = 0; j < 2; j++) sgt[u].x[i][j] = 0ll;     for (int i = 0; i < 2; i++)       for (int j = 0; j < 2; j++)         if (!f[mid][i][j]) {           for (int ii = 0; ii < 2; ii++)             for (int jj = 0; jj < 2; jj++) {               sgt[u].x[ii][jj] += sgt[u << 1].x[ii][i] * sgt[u << 1 | 1].x[j][jj];             }         }     for (int i = 0; i < 2; i++)       for (int j = 0; j < 2; j++) {         sgt[u].x[i][j] %= P;       }   }   void build(int u, int le, int ri) {     if (le == ri) {       sgt[u].x[0][0] = P + 1 - a[le].p, sgt[u].x[1][1] = a[le].p;       return;     }     int mid = (le + ri) >> 1;     build(u << 1, le, mid);     build(u << 1 | 1, mid + 1, ri);     pushup(u, mid);   }   void update(int u, int le, int ri, int pos) {     if (le == ri) {       return;     }     int mid = (le + ri) >> 1;     if (pos <= mid) {       update(u << 1, le, mid, pos);     } else {       update(u << 1 | 1, mid + 1, ri, pos);     }     pushup(u, mid);   }   long long query() {     return (sgt[1].x[0][0] + sgt[1].x[0][1] + sgt[1].x[1][0] + sgt[1].x[1][1]) %            P;   }   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       scanf( %I64d%I64d%I64d , &a[i].x, &a[i].v, &a[i].p);       a[i].p = a[i].p * mulinv(100) % P;     }     for (int i = 1; i < n; i++) {       ev[++m].u = i, ev[m].x = 1, ev[m].y = 0, ev[m].t1 = a[i + 1].x - a[i].x,       ev[m].t2 = a[i].v + a[i + 1].v;       if (a[i].v < a[i + 1].v) {         ev[++m].u = i, ev[m].x = 0, ev[m].y = 0, ev[m].t1 = a[i + 1].x - a[i].x,         ev[m].t2 = a[i + 1].v - a[i].v;       } else if (a[i].v > a[i + 1].v) {         ev[++m].u = i, ev[m].x = 1, ev[m].y = 1, ev[m].t1 = a[i + 1].x - a[i].x,         ev[m].t2 = a[i].v - a[i + 1].v;       }     }     sort(ev + 1, ev + m + 1);     long long ans = 0ll, prob = 1ll;     build(1, 1, n);     for (int i = 1; i <= m; i++) {       f[ev[i].u][ev[i].x][ev[i].y] = 1;       update(1, 1, n, ev[i].u);       long long tmp = query(), tim = ev[i].t1 * mulinv(ev[i].t2) % P;       ans = (ans + (prob - tmp + P) * tim) % P;       prob = tmp;     }     printf( %I64d n , ans);     return 0;   }   