Coprime Permutation
698F3000· legendary gm2s256 MB⌨ stdin/stdout
Examples
Sample 1of 4
Input
40 0 0 0
Output
4
Sample 2of 4
Input
50 0 1 2 0
Output
2
Sample 3of 4
Input
60 0 1 2 0 0
Output
0
Sample 4of 4
Input
55 3 4 2 1
Output
0
58%
698F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)