cf/mirror

Divisor Card Game

CF
2172D3100· legendary gm1s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
5 2
1 2 3 4 5
0 0 1 2 1
Output
499122179 499122179
Sample 2of 3
Input
6 2
1 2 3 4 5 6
0 0 0 1 0 2
Output
831870297 166374061
Sample 3of 3
Input
8 3
4 5 8 9 12 18 20 24
0 0 0 0 0 2 1 3
Output
332748120 2 665496239
2172D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)