Rainbow Rectangles
1396D3300· legendary gm4s512 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
4 2 43 2 23 1 11 1 11 2 1
Output
20
Sample 2of 3
Input
5 3 106 5 35 3 17 9 12 3 25 0 2
Output
300
Sample 3of 3
Input
10 4 105 4 40 0 36 0 13 9 28 7 18 1 32 1 36 3 23 5 34 3 4
Output
226
58%
1396D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)