cf/mirror

Sum of Paths

CF
1467D2200· master3s1024 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
5 1 5
3 5 1 4 2
1 9
2 4
3 6
4 6
5 2
Output
62
58
78
86
86
Sample 2of 3
Input
5 2 5
3 5 1 4 2
1 9
2 4
3 6
4 6
5 2
Output
157
147
207
227
227
Sample 3of 3
Input
4 40 6
92 21 82 46
3 56
1 72
4 28
1 97
2 49
2 88
Output
239185261
666314041
50729936
516818968
766409450
756910476
1467D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)