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

Problem_ID: A
Result: Accepted
Time: 308ms
Memory: 25316kB
Author: 13587528131
In contest: 1296

for tcase in range(int(input())):
    a,b,c=map(int,input().split())
    d=list(map(int,input().split()))
    d.sort()
    total,wxa=0,0
    for i in range(b):
        total=total+d[i]
    if total-a>0:
        print(total-a)
    else:
        print("0")