Lunar New Year and Red Envelopes
1106E2100· master3s256 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
5 0 21 3 4 52 5 5 8
Output
13
Sample 2of 3
Input
10 1 61 1 2 42 2 6 23 3 3 34 4 4 55 5 5 76 6 6 9
Output
2
Sample 3of 3
Input
12 2 61 5 5 44 6 6 23 8 8 32 9 9 56 10 10 78 12 12 9
Output
11
58%
1106E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)