‘你今天AC了吗’ 团队内部赛彭德巡回赛 彩蛋题 Solitary Dream

‘你今天AC了吗’ 团队内部赛彭德巡回赛 彩蛋题 Solitary Dream

题目背景

\(静寂に問う\space\space\space\space\space\space\space\space答えを求めて\)

题目描述

Hikari felt regret and alone after she killed Tairitsu, although they had hatred before. She cried and she couldn't control her emotion. She destory this bad world--Arcaea. And just wanna Tairitsu can appear in front of her. But that is impossible, Tairitsu has dead and no one can rebirth Tairitsu. But she had to try, rebirth her enemy but friend--Tairitsu. Now Hikari use her God Power and break the rules to rebirth Tairitsu. Here are some potions to let Tairitsu rebirth, every potion needs \(a_i\) power
to make it. Tell Hikari how many power she need to rebirth Tairitsu.

输入格式

The first line of input contains one integers \(n\) — How many power Hikari have.

The second line of input contains some integers \(a_1,a_2,\dots, t_x\) — the needed power to make the potions.

输出格式

Only one integer — How many power does Hikari left after she make all the potions.**If Hikari doesn't have enough power to make them all, Output -1**

样例 #1

样例输入 #1

5
1 1 1

样例输出 #1

2

样例 #2

样例输入 #2

4
1 2 5

样例输出 #2

-1

提示

Every integers of the input can use int of C to refers.

信息

ID
1015
难度
(无)
分类
(无)
标签
(无)
递交数
0
已通过
0
通过率
?
上传者

相关

在下列训练计划中:

“你今天AC了吗”团队原创