HZNUOJ


Problem_ID: A
Result: Accepted
Time: 376ms
Memory: 25316kB
Author: 15258406436
In contest: 1296

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