cf/mirror

Staircases

CF
1598E2100· master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
2 2 8
1 1
1 1
1 1
2 2
1 1
1 2
2 1
1 1
Output
5
10
5
2
5
3
1
0
Sample 2of 3
Input
3 4 10
1 4
1 2
2 3
1 2
2 3
3 2
1 3
3 4
1 3
3 1
Output
49
35
24
29
49
39
31
23
29
27
Sample 3of 3
Input
1000 1000 2
239 634
239 634
Output
1332632508
1333333000
1598E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…