1327: 平分数字(一)

Memory Limit:256 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:41 Solved:10

Description

给定 $n$ 个整数:$a_1,a_2,⋯,a_n$,请判定能否将它们分成两个部分(任一部分都不能为空)(不得丢弃任何数字),每部分的数字之和一样大。

Input

第一行:单个整数 $n$;
第二行:$n$ 个整数,表示 $a_1,a_2,⋯,a_n$。

Output

若能否平分,输出 Matched,否则输出 No

Sample Input Copy

4
1 2 3 4

Sample Output Copy

Matched

HINT

样例说明

$1 + 4 = 2 + 3$


数据范围

- 对于 $50\%$ 的数据,$1≤n≤18$;
- 对于 $100\%$ 的数据,$1≤n≤24$;
- $−10,000,000≤a_i≤10,000,000$

Source/Category