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;
long long inf;
const double eps = 1e-8;
const double pi = acos(-1.0);
template <class T>
long long chkmin(T &a, T b) {
  return a > b ? a = b, 1 : 0;
}
template <class T>
long long chkmax(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
T sqr(T a) {
  return a * a;
}
template <class T>
T mmin(T a, T b) {
  return a < b ? a : b;
}
template <class T>
T mmax(T a, T b) {
  return a > b ? a : b;
}
template <class T>
T aabs(T a) {
  return a < 0 ? -a : a;
}
template <class T>
long long dcmp(T a, T b) {
  return a > b;
}
template <long long *a>
long long cmp_a(long long first, long long second) {
  return a[first] < a[second];
}
struct __INIT__ {
  __INIT__() { memset(&inf, 0x3f, sizeof(inf)); }
} __INIT___;
namespace io {
const long long SIZE = (1 << 21) + 1;
char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1, c,
                                       qu[55];
long long f, qr;
inline void flush() {
  fwrite(obuf, 1, oS - obuf, stdout);
  oS = obuf;
}
inline void putc(char first) {
  *oS++ = first;
  if (oS == oT) flush();
}
template <typename A>
inline bool read(A &first) {
  for (f = 1, c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                              (iS == iT ? EOF : *iS++))
                            : *iS++);
       c < '0' || c > '9';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    if (c == '-')
      f = -1;
    else if (c == EOF)
      return 0;
  for (first = 0; c <= '9' && c >= '0';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    first = first * 10 + (c & 15);
  first *= f;
  return 1;
}
inline bool read(char &first) {
  while ((first = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                               (iS == iT ? EOF : *iS++))
                            : *iS++)) == ' ' ||
         first == '\n' || first == '\r')
    ;
  return first != EOF;
}
inline bool read(char *first) {
  while ((*first = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                                (iS == iT ? EOF : *iS++))
                             : *iS++)) == '\n' ||
         *first == ' ' || *first == '\r')
    ;
  if (*first == EOF) return 0;
  while (!(*first == '\n' || *first == ' ' || *first == '\r'))
    *(++first) = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                              (iS == iT ? EOF : *iS++))
                           : *iS++);
  *first = 0;
  return 1;
}
template <typename A, typename... B>
inline bool read(A &first, B &...second) {
  return read(first) && read(second...);
}
template <typename A>
inline bool write(A first) {
  if (!first) putc('0');
  if (first < 0) putc('-'), first = -first;
  while (first) qu[++qr] = first % 10 + '0', first /= 10;
  while (qr) putc(qu[qr--]);
  return 0;
}
inline bool write(char first) {
  putc(first);
  return 0;
}
inline bool write(const char *first) {
  while (*first) {
    putc(*first);
    ++first;
  }
  return 0;
}
inline bool write(char *first) {
  while (*first) {
    putc(*first);
    ++first;
  }
  return 0;
}
template <typename A, typename... B>
inline bool write(A first, B... second) {
  return write(first) || write(second...);
}
struct Flusher_ {
  ~Flusher_() { flush(); }
} io_flusher_;
}  // namespace io
using io ::putc;
using io ::read;
using io ::write;
const long long cy = 998244353, i100 = 828542813;
long long a[100005], v[100005], p[100005];
struct matrix {
  long long a[2][2];
  long long *operator[](long long b) { return a[b]; }
  matrix operator*(matrix b) {
    matrix c;
    for (long long i = 0; i < 2; ++i)
      for (long long j = 0; j < 2; ++j) c[i][j] = 0;
    for (long long i = 0; i < 2; ++i)
      for (long long k = 0; k < 2; ++k)
        for (long long j = 0; j < 2; ++j)
          c[i][j] = (c[i][j] + a[i][k] * b[k][j]) % cy;
    return c;
  }
};
matrix w[100005];
struct smt {
  matrix mul;
  long long ls, rs;
  smt *l, *r;
  smt(long long la, long long ra) {
    ls = la;
    rs = ra;
    if (ls == rs) {
      mul = w[ls];
      l = r = 0;
      return;
    }
    long long mid = (ls + rs) >> 1;
    l = new smt(ls, mid);
    r = new smt(mid + 1, rs);
    mul = r->mul * l->mul;
  }
  void reset(long long first) {
    if (ls == rs) {
      mul = w[first];
      return;
    }
    if (first <= l->rs)
      l->reset(first);
    else
      r->reset(first);
    mul = r->mul * l->mul;
  }
};
smt *rt;
long long fpm(long long a, long long b) {
  long long c = 1;
  for (; b; b >>= 1, a = a * a % cy)
    if (b & 1) c = c * a % cy;
  return c;
}
struct frac {
  long long first, second, id;
  frac(long long a = 0, long long b = 0, long long c = 0) {
    first = a;
    second = b;
    id = c;
  }
  bool operator<(const frac &b) const {
    return first * b.second < second * b.first;
  }
};
frac s[200005];
signed main() {
  long long n;
  read(n);
  for (long long i = 1; i <= n; ++i) {
    read(a[i], v[i], p[i]);
    p[i] = p[i] * i100 % cy;
  }
  long long m = 0;
  for (long long i = 2; i <= n; ++i) {
    s[++m] = frac(a[i] - a[i - 1], v[i] + v[i - 1], i);
    if (v[i] != v[i - 1])
      s[++m] = frac(a[i] - a[i - 1], aabs(v[i] - v[i - 1]), -i);
  }
  sort(s + 1, s + m + 1);
  for (long long i = 1; i <= n; ++i) {
    w[i][1][0] = w[i][1][1] = p[i];
    w[i][0][0] = w[i][0][1] = (cy + 1 - p[i]) % cy;
    if (i == 1) {
      w[i][1][1] = w[i][0][1] = 0;
    }
  }
  rt = new smt(1, n);
  long long ans = 0;
  for (long long i = 1; i <= m; ++i) {
    long long id = s[i].id, is = id > 0;
    if (!is) id = -id;
    matrix ww = w[id];
    if (is) {
      w[id][1][0] = w[id][0][0] = w[id][1][1] = 0;
    } else if (v[id - 1] < v[id]) {
      w[id][1][0] = w[id][0][1] = w[id][1][1] = 0;
    } else {
      w[id][1][0] = w[id][0][1] = w[id][0][0] = 0;
    }
    rt->reset(id);
    ans = (ans + s[i].first * fpm(s[i].second, cy - 2) % cy *
                     (rt->mul[0][0] + rt->mul[1][0])) %
          cy;
    w[id] = ww;
    if (is) {
      w[id][0][1] = 0;
    } else {
      if (v[id - 1] < v[id]) {
        w[id][0][0] = 0;
      } else {
        w[id][1][1] = 0;
      }
    }
    rt->reset(id);
  }
  write(ans, '\n');
  return 0;
}