cf/mirror

Bouquet (Hard Version)

CF
1995B21700· expert1.5s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
7
3 10
1 2 3
2 2 1
3 1033
206 207 1000
3 4 1
6 20
4 2 7 5 6 1
1 2 1 3 1 7
8 100000
239 30 610 122 24 40 8 2
12 13123 112 1456 124 100 123 10982
6 13
2 4 11 1 3 5
2 2 1 2 2 1
8 10330
206 210 200 201 198 199 222 1000
9 10 11 12 13 14 15 16
2 10000000000
11 12
87312315 753297050
Output
7
1033
19
99990
13
10000
9999999999
1995B2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)