cf/mirror

Businessmen Problems

CF
981B1000· newbie2s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
3
1 2
7 2
3 10
4
1 4
2 4
3 4
4 4
Output
24
Sample 2of 2
Input
1
1000000000 239
3
14 15
92 65
35 89
Output
408
981B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)