Problem: An infinitely long Line Chillland Collider (LCC) was built in Chillland. There are n pipes with coordinates x_i that are connected to LCC. When the experiment starts at time 0, i-th proton flies from the i-th pipe with speed v_i. It flies to the right with probability p_i and flies to the left with probability (1 - p_i). The duration of the experiment is determined as the time of the first collision of any two protons. In case there is no collision, the duration of the experiment is considered to be zero.

Find the expected value of the duration of the experiment.

<image>Illustration for the first example

Input

The first line of input contains one integer n — the number of pipes (1 ≤ n ≤ 10^5). Each of the following n lines contains three integers x_i, v_i, p_i — the coordinate of the i-th pipe, the speed of the i-th proton and the probability that the i-th proton flies to the right in percentage points (-10^9 ≤ x_i ≤ 10^9, 1 ≤ v ≤ 10^6, 0 ≤ p_i ≤ 100). It is guaranteed that all x_i are distinct and sorted in increasing order.

Output

It's possible to prove that the answer can always be represented as a fraction P/Q, where P is an integer and Q is a natural number not divisible by 998 244 353. In this case, print P ⋅ Q^{-1} modulo 998 244 353.

Examples

Input


2
1 1 100
3 1 0


Output


1


Input


3
7 10 0
9 4 86
14 5 100


Output


0


Input


4
6 4 50
11 25 50
13 16 50
15 8 50


Output


150902884

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
inline int gi() {
  register int data = 0, w = 1;
  register char ch = 0;
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') w = -1, ch = getchar();
  while (isdigit(ch)) data = 10 * data + ch - '0', ch = getchar();
  return w * data;
}
const int Mod = 998244353, Inv = 828542813;
int fpow(int x, int y) {
  int res = 1;
  while (y) {
    if (y & 1) res = 1ll * res * x % Mod;
    x = 1ll * x * x % Mod;
    y >>= 1;
  }
  return res;
}
const int MAX_N = 1e5 + 5;
struct Matrix {
  int m[2][2];
  Matrix() { memset(m, 0, sizeof(m)); }
  int *operator[](const int &id) { return m[id]; }
  Matrix operator*(const Matrix &r) const {
    Matrix res;
    for (int i = 0; i < 2; i++)
      for (int k = 0; k < 2; k++) {
        if (!m[i][k]) continue;
        for (int j = 0; j < 2; j++)
          res[i][j] = (res[i][j] + 1ll * m[i][k] * r.m[k][j]) % Mod;
      }
    return res;
  }
  int sum() { return (m[0][0] + m[0][1]) % Mod; }
};
Matrix val[MAX_N << 2];
int N, x[MAX_N], v[MAX_N], P[MAX_N];
void build(int o, int l, int r) {
  if (l == r) {
    val[o][0][0] = val[o][1][0] = Mod + 1 - P[l];
    val[o][0][1] = val[o][1][1] = P[l];
    return;
  }
  int mid = (l + r) >> 1;
  build((o << 1), l, mid);
  build((o << 1 | 1), mid + 1, r);
  val[o] = val[(o << 1)] * val[(o << 1 | 1)];
}
void modify(int o, int l, int r, int pos, int a, int b) {
  if (l == r) return (void)(val[o][a][b] = 0);
  int mid = (l + r) >> 1;
  if (pos <= mid)
    modify((o << 1), l, mid, pos, a, b);
  else
    modify((o << 1 | 1), mid + 1, r, pos, a, b);
  val[o] = val[(o << 1)] * val[(o << 1 | 1)];
}
struct node {
  int len, spd, x, y, id;
} o[MAX_N << 2];
bool operator<(const node &l, const node &r) {
  return 1ll * l.len * r.spd < 1ll * r.len * l.spd;
}
int cnt;
int main() {
  N = gi();
  for (int i = 1; i <= N; i++)
    x[i] = gi(), v[i] = gi(), P[i] = 1ll * gi() * Inv % Mod;
  build(1, 1, N);
  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 + 1] - v[i], 0, 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};
  }
  sort(&o[1], &o[cnt + 1]);
  int ans = 0;
  for (int i = 1; i <= cnt; i++) {
    int tmp = val[1].sum();
    modify(1, 1, N, o[i].id, o[i].x, o[i].y);
    ans = (ans + 1ll * o[i].len * fpow(o[i].spd, Mod - 2) % Mod *
                     (tmp - val[1].sum() + Mod)) %
          Mod;
  }
  printf("%d\n", ans);
  return 0;
}