HZNUOJ


Problem_ID: A
Result: Accepted
Time: 265ms
Memory: 25308kB
Author: 13666776648
In contest: 1300

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