cf/mirror

Fox and Card Game

CF
388C2000· candidate master1s256 MB⌨ stdin/stdout

Examples

Sample 1of 4
Input
2
1 100
2 1 10
Output
101 10
Sample 2of 4
Input
1
9 2 8 6 5 9 4 7 1 3
Output
30 15
Sample 3of 4
Input
3
3 1 3 2
3 5 4 6
2 8 7
Output
18 18
Sample 4of 4
Input
3
3 1000 1000 1000
6 1000 1000 1000 1000 1000 1000
5 1000 1000 1000 1000 1000
Output
7000 7000
388C.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)