#3803. C++-GESP 2025-06认证三级-编程题02(分糖果)

C++-GESP 2025-06认证三级-编程题02(分糖果)

Background

Description

image

image

Format

Input

Output

Samples

4
1 4 3 3
16
15
314 15926 53589793 238462643 383279502 8 8 4 1 9 7 1 6 9 3
4508143253

Limitation

1s, 1024KiB for each test case.