cf/mirror

Finding Expected Value

CF
1575F2900· international gm3s512 MB⌨ stdin/stdout
#math

Examples

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