Nanosoft
1301E2500· grandmaster2s512 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
5 5 5RRGGBRRGGYYYBBGYYBBRRBBRG1 1 5 52 2 5 52 2 3 31 1 3 54 4 5 5
Output
164440
Sample 2of 3
Input
6 10 5RRRGGGRRGGRRRGGGRRGGRRRGGGYYBBYYYBBBYYBBYYYBBBRGRGYYYBBBYBYB1 1 6 101 3 3 102 2 6 61 7 6 102 1 5 10
Output
364161616
Sample 3of 3
Input
8 8 8RRRRGGGGRRRRGGGGRRRRGGGGRRRRGGGGYYYYBBBBYYYYBBBBYYYYBBBBYYYYBBBB1 1 8 85 2 5 73 1 8 62 3 5 81 2 6 82 1 5 52 1 7 76 5 7 5
Output
640164164360
58%
1301E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)