cf/mirror

Choosing Balls

CF
264C2000· candidate master5s256 MB⌨ stdin/stdout
#dp

Examples

Sample 1of 2
Input
6 3
1 -2 3 4 0 -1
1 2 1 2 1 1
5 1
-2 1
1 0
Output
20
9
4
Sample 2of 2
Input
4 1
-3 6 -1 2
1 2 3 1
1 -1
Output
5
264C.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)