# TopCoder

Caido
$\mathbb{W}\mathcal{aimai}\sim$

80.0% (8/10)

51.7% (15/29)

# Description

#### 測資限制

• $1 \leq A,B,C \leq N \leq 10^ 5$
• $A+B+C=N$
• $1 \leq a_i,b_i,c_i \leq 10^ 9$

3 1 1 1
4 1 6
1 1 10
5 7 4

21

6 3 2 1
1000000000 1 1
1000000000 1 1
1000000000 1 1
1 1000000000 1
1 1000000000 1
1 1 1000000000

6000000000

# Problem Source

2021 師大附中校隊培訓 模擬競賽

No. Testdata Range Constraints Score
1 0~1 範例測資 0
2 0~6 $N \le 18$ 9
3 0~1, 7~17 $C = 1$ 17
4 0~6, 18~24 $N \le 500$ 19
5 0~6, 18~27 $N \le 5000$ 24
6 0~32 無額外限制 31

# Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 524288 65536 1 2 3 4 5 6
1 1000 524288 65536 1 2 3 4 5 6
2 1000 524288 65536 2 4 5 6
3 1000 524288 65536 2 4 5 6
4 1000 524288 65536 2 4 5 6
5 1000 524288 65536 2 4 5 6
6 1000 524288 65536 2 4 5 6
7 1000 524288 65536 3 6
8 1000 524288 65536 3 6
9 1000 524288 65536 3 6
10 1000 524288 65536 3 6
11 1000 524288 65536 3 6
12 1000 524288 65536 3 6
13 1000 524288 65536 3 6
14 1000 524288 65536 3 6
15 1000 524288 65536 3 6
16 1000 524288 65536 3 6
17 1000 524288 65536 3 6
18 1000 524288 65536 4 5 6
19 1000 524288 65536 4 5 6
20 1000 524288 65536 4 5 6
21 1000 524288 65536 4 5 6
22 1000 524288 65536 4 5 6
23 1000 524288 65536 4 5 6
24 1000 524288 65536 4 5 6
25 1000 524288 65536 5 6
26 1000 524288 65536 5 6
27 1000 524288 65536 5 6
28 1000 524288 65536 6
29 1000 524288 65536 6
30 1000 524288 65536 6
31 1000 524288 65536 6
32 1000 524288 65536 6