#P17385. [PacNW 2025] Honkai Stress Relief

    ID: 17447 Type: RemoteJudge 1000ms 2048MiB Tried: 0 Accepted: 0 Difficulty: 3 Uploaded By: Tags>数学2025Special JudgeICPC

[PacNW 2025] Honkai Stress Relief

题目描述

After finishing her last exam, Audrey decides to relax by playing Honkai: Star Rail.

On each of the next nn days, she plays during an open time interval (s,e)(s,e). Her smartwatch checks her stress once per day. It independently chooses a real time t0t_0 uniformly at random from the open interval (a,b)(a,b). If s<t0<es<t_0<e, the watch reports that Audrey is relaxed; otherwise, it reports that she is stressed. The values aa and bb are the same every day.

Compute the probability that the watch reports Audrey as stressed on at least one day.

输入格式

The first line contains three integers nn, aa, and bb (1≤n≤201\le n\le20, 1≤a<b≤501\le a<b\le50).

Each of the next nn lines contains two integers ss and ee (1≤s<e≤501\le s<e\le50), Audrey's open playing interval on that day.

输出格式

Output the probability that Audrey is reported as stressed on at least one day. An answer is accepted if its absolute or relative error is at most 10−610^{-6}.

2 19 39
18 31
28 50
0.67