Start: Jul, 06, 2019 10:00:00
20190706Python程序设计基础培训扩展练习
End: Jul, 17, 2019 12:00:00
Time elapsed:
Time remaining:

Problem_ID: A
Result: Accepted
Time: 277ms
Memory: 25316kB
Author: 13336131920
In contest: 1300

for i in range(int(input())):#几组测试数据
    n,k,m=map(int,input().split())#输入钱 鱼个数
    lst=list(map(int,input().split()))
    lst.sort()
    need_money=sum(lst[:k])
    print(0 if n>need_money else need_money-n)