#include <bits/stdc++.h>
using namespace std;
const int _ = 1e5 + 5, Mo = 998244353, Inv = 828542813;
int power(int x, int k) {
  int res = 1;
  for (; k; k >>= 1, x = 1ll * x * x % Mo)
    if (k & 1) res = 1ll * res * x % Mo;
  return res % Mo;
}
struct Matrix {
  int a[2][2];
  Matrix() { memset(a, 0, sizeof a); }
  int* operator[](int id) { return a[id]; }
  Matrix operator*(Matrix b) const {
    Matrix ans;
    for (int i = 0; i < 2; ++i)
      for (int j = 0; j < 2; ++j)
        for (int k = 0; k < 2; ++k)
          ans[i][j] = (ans[i][j] + 1ll * a[i][k] * b[k][j] % Mo) % Mo;
    return ans;
  }
} t[_ << 2];
int n, x[_], v[_], P[_];
int cnt;
struct node {
  int x, v, a, b, id;
} o[_ << 1];
int cmp(node a, node b) { return 1ll * a.x * b.v < 1ll * b.x * a.v; }
int lc(int p) { return p << 1; }
int rc(int p) { return p << 1 | 1; }
void pushup(int p) { t[p] = t[lc(p)] * t[rc(p)]; }
void build(int p = 1, int l = 1, int r = n) {
  if (l == r) {
    t[p][0][0] = t[p][1][0] = Mo + 1 - P[l];
    t[p][0][1] = t[p][1][1] = P[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(lc(p), l, mid), build(rc(p), mid + 1, r), pushup(p);
}
void update(int x, int a, int b, int p = 1, int l = 1, int r = n) {
  if (l == r) {
    t[p][a][b] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid)
    update(x, a, b, lc(p), l, mid);
  else
    update(x, a, b, rc(p), mid + 1, r);
  pushup(p);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i)
    scanf("%d %d %d", x + i, v + i, P + i), P[i] = 1ll * P[i] * Inv % Mo;
  build();
  for (int i = 1; i < n; ++i) {
    o[++cnt] = (node){x[i + 1] - x[i], v[i] + v[i + 1], 1, 0, i + 1};
    if (v[i] > v[i + 1])
      o[++cnt] = (node){x[i + 1] - x[i], v[i] - v[i + 1], 1, 1, i + 1};
    if (v[i] < v[i + 1])
      o[++cnt] = (node){x[i + 1] - x[i], v[i + 1] - v[i], 0, 0, i + 1};
  }
  sort(o + 1, o + cnt + 1, cmp);
  int ans = 0;
  for (int i = 1; i <= cnt; ++i) {
    int tmp = (t[1][0][0] + t[1][0][1]) % Mo;
    update(o[i].id, o[i].a, o[i].b);
    ans = (ans + 1ll * o[i].x * power(o[i].v, Mo - 2) % Mo *
                     (tmp - (t[1][0][0] + t[1][0][1]) % Mo + Mo) % Mo) %
          Mo;
  }
  printf("%d\n", ans);
  return 0;
}
