logo AlgoBeat OnlineJudge
登录 注册

#217694. [PacNW 2025] Honkai Stress Relief

内存限制:2048 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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

On each of the next days, she plays during an open time interval . Her smartwatch checks her stress once per day. It independently chooses a real time uniformly at random from the open interval . If , the watch reports that Audrey is relaxed; otherwise, it reports that she is stressed. The values and 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 , , and (, ).

Each of the next lines contains two integers and (), 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 .

样例

样例输入 1

2 19 39
18 31
28 50

样例输出 1

0.67