cf/mirror

Sakura Adachi and Optimal Sequences

CF
2171G2000· candidate master4s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
8
6
1 3 6 4 3 2
3 7 10 4 4 8
2
1 1
4 3
5
2 3 2 5 1
18 13 10 30 7
5
5 4 3 6 2
100 125 231 113 107
4
2 2 2 2
2 2 2 2
4
1 1 1 1
2 2 2 2
7
1 1 1 1 1 1 200000
200000 200000 200000 200000 200000 200000 200000
3
542264 174876 441510
641112 325241 995342
Output
17 827116
3 1
12 288
35 567812
0 1
1 1
1199994 0
803045 366998
2171G.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)