#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 100, mod = 998244353, inf = 2e9;   int n, p[N], v[N], x[N], cnt, ans;   int qpow(int x, int y) {     int ret = 1;     while (y) {       if (y & 1) ret = 1ll * ret * x % mod;       x = 1ll * x * x % mod, y >>= 1;     }     return ret;   }   struct node {     int x, y, p, q, tp;     bool operator<(const node &tp) const {       return 1ll * p * tp.q < 1ll * q * tp.p;     }   } res[N * 3];   struct matrix {     int s[2][2];     void init(int o) {       if (o == 1)         for (int i = 0; i < 2; ++i)           for (int j = 0; j < 2; ++j) s[i][j] = (i == j);       else {         for (int i = 0; i < 2; ++i)           for (int j = 0; j < 2; ++j) s[i][j] = 0;         s[0][0] = 1;       }     }     matrix operator*(matrix b) {       matrix ret;       for (int i = 0; i < 2; ++i)         for (int j = 0; j < 2; ++j) {           ret.s[i][j] = 0;           for (int k = 0; k < 2; ++k)             ret.s[i][j] = (ret.s[i][j] + 1ll * s[i][k] * b.s[k][j]) % mod;         }       return ret;     }   } trans[N], I, H;   struct SegmentTree {     int L[N << 2], R[N << 2];     matrix F[N << 2];     void build(int k, int l, int r) {       L[k] = l, R[k] = r;       if (l == r) {         F[k] = trans[l];         return;       }       int mid = l + r >> 1;       build(k << 1, l, mid);       build(k << 1 | 1, mid + 1, r);       F[k] = F[k << 1] * F[k << 1 | 1];     }     matrix Query(int k, int l, int r) {       if (r < l) return I;       if (l <= L[k] && R[k] <= r) {         return F[k];       }       int mid = L[k] + R[k] >> 1;       matrix ret = I;       if (l <= mid) ret = Query(k << 1, l, r);       if (r > mid) ret = ret * Query(k << 1 | 1, l, r);       return ret;     }     void Modify(int k, int x) {       if (L[k] == R[k]) {         F[k] = trans[x];         return;       }       int mid = L[k] + R[k] >> 1;       if (x <= mid)         Modify(k << 1, x);       else         Modify(k << 1 | 1, x);       F[k] = F[k << 1] * F[k << 1 | 1];     }   } Tr;   int main() {     scanf( %d , &n);     for (int i = 1, c = qpow(100, mod - 2); i <= n; ++i)       scanf( %d%d%d , &x[i], &v[i], &p[i]), p[i] = mod + 1 - 1ll * c * p[i] % mod,                                             p[i] %= mod;     if (n == 1) {       puts( 0 );       return 0;     }     for (int i = 2; i <= n; ++i) {       if (v[i] > v[i - 1])         res[++cnt] = (node){i - 1, i, x[i] - x[i - 1], v[i] - v[i - 1], 0};       res[++cnt] = (node){i - 1, i, x[i] - x[i - 1], v[i] + v[i - 1], 1};       if (v[i - 1] > v[i])         res[++cnt] = (node){i - 1, i, x[i] - x[i - 1], v[i - 1] - v[i], 2};     }     sort(res + 1, res + cnt + 1);     I.init(1);     H.init(2);     for (int i = 1; i <= n; ++i)       trans[i].s[0][0] = trans[i].s[1][0] = p[i],       trans[i].s[0][1] = trans[i].s[1][1] = (mod + 1 - p[i]) % mod;     Tr.build(1, 1, n);     for (int i = 1; i <= cnt; ++i) {       int x = res[i].x, y = res[i].y;       matrix pre = Tr.Query(1, 1, x), suf = Tr.Query(1, y + 1, n), Y;       Y.init(2);       Y.s[0][0] = 0;       if (res[i].tp == 0) Y.s[0][0] = p[y];       if (res[i].tp == 1) Y.s[1][0] = p[y];       if (res[i].tp == 2) Y.s[1][1] = (1 + mod - p[y]) % mod;       matrix tmp = pre * Y * suf;       ans = (ans + 1ll * (tmp.s[0][1] + tmp.s[0][0]) * res[i].p % mod *                        qpow(res[i].q, mod - 2) % mod) %             mod;       if (res[i].tp == 0) trans[y].s[0][0] = 0;       if (res[i].tp == 1) trans[y].s[1][0] = 0;       if (res[i].tp == 2) trans[y].s[1][1] = 0;       Tr.Modify(1, y);     }     printf( %d , ans);     return 0;   }   