HZNUOJ


Problem_ID: A
Result: Accepted
Time: 281ms
Memory: 25316kB
Author: 18957836090
In contest: 1300

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