cf/mirror

Villagers

CF
2133B800· newbie1s256 MB⌨ stdin/stdout
#greedy

Examples

Sample 1of 1multi-test • hover to link
Input
4
2
1 2
4
2 1 5 2
5
1000000000 1000000000 1000000000 1000000000 1000000000
6
3 1 4 1 5 9
Output
2
7
3000000000
14
2133B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)