Problem D

Statement
Copy Copied
Description:
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.

Illustration for the first example

Input Format:
The first line of input contains one integer $$$n$$$ — the number of pipes ($$$1 \le n \le 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 \le x_i \le 10^9, 1 \le v \le 10^6, 0 \le p_i \le 100$$$). It is guaranteed that all $$$x_i$$$ are distinct and sorted in increasing order.

Output Format:
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 \cdot Q^{-1}$$$ modulo $$$998\,244\,353$$$.

Note:
None

Submissions

IDLanguageExit CodeTimestampCodeStdoutStderrRetry
5242 go 0 2026-03-12T06:12:07.198386Z View View View Retry
5222 go 1 2026-03-12T05:42:29.201132Z View View View Retry
5210 go 1 2026-03-12T05:24:32.465982Z View View View Retry

Evaluations

Eval IDRun IDProviderModelLangSuccessTimestampPromptResponseStdoutStderrRetry
2202 20260311-031318 openai gpt-5.4 go false 2026-03-11T05:42:10.94217Z View View View View Retry