CF1286D.LCC
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
An infinitely long Line Chillland Collider (LCC) was built in Chillland. There are n pipes with coordinates xi that are connected to LCC. When the experiment starts at time 0, i -th proton flies from the i -th pipe with speed vi . It flies to the right with probability pi and flies to the left with probability (1−pi) . 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.
Illustration for the first example
输入格式
The first line of input contains one integer n — the number of pipes ( 1≤n≤105 ). Each of the following n lines contains three integers xi , vi , pi — 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 ( −109≤xi≤109,1≤v≤106,0≤pi≤100 ). It is guaranteed that all xi are distinct and sorted in increasing order.
输出格式
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 998244353 . In this case, print P⋅Q−1 modulo 998244353 .
输入输出样例
输入#1
2 1 1 100 3 1 0
输出#1
1
输入#2
3 7 10 0 9 4 86 14 5 100
输出#2
0
输入#3
4 6 4 50 11 25 50 13 16 50 15 8 50
输出#3
150902884