cf/mirror

Stock Exchange

CF
1178H3500· legendary gm6s16 MB⌨ stdin/stdout

Examples

Sample 1of 5
Input
1
3 10
1 16
Output
3 1
Sample 2of 5
Input
2
3 0
2 1
1 10
1 11
Output
6 3
Sample 3of 5
Input
1
42 42
47 47
Output
-1
Sample 4of 5
Input
8
145 1729363
891 4194243
424 853731
869 1883440
843 556108
760 1538373
270 762781
986 2589382
610 99315884
591 95147193
687 99248788
65 95114537
481 99071279
293 98888998
83 99764577
769 96951171
Output
434847 11
Sample 5of 5
Input
8
261 261639
92 123277
271 131614
320 154417
97 258799
246 17926
117 222490
110 39356
85 62864876
86 62781907
165 62761166
252 62828168
258 62794649
125 62817698
182 62651225
16 62856001
Output
1010327 11
1178H.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…