cf/mirror

Polycarp and Sums of Subsequences

CF
1618A800· newbie1s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
5
1 3 4 4 5 7 8
1 2 3 4 5 6 7
300000000 300000000 300000000 600000000 600000000 600000000 900000000
1 1 2 999999998 999999999 999999999 1000000000
1 2 2 3 3 4 5
Output
1 4 3
4 1 2
300000000 300000000 300000000
999999998 1 1
1 2 2
1618A.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)