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: 428ms
Memory: 25312kB
Author: 13105725336
In contest: 1300

for i in range(int(input())):
    n,k,m=map(int,input().split())
    ls=list(map(int,input().split()))
    ls.sort()
    s=sum(ls[:k])
    s1=s-n
    if s1>0:
        print(s1)
    else:

        print(0)