#include <bits/stdc++.h>
#define pb push_back
#define nl puts ("")
#define sp printf ( " " )
#define phl printf ( "hello\n" )
#define ff first
#define ss second
#define POPCOUNT __builtin_popcountll
#define RIGHTMOST __builtin_ctzll
#define LEFTMOST(x) (63-__builtin_clzll((x)))
#define MP make_pair
#define FOR(i,x,y) for(vlong i = (x) ; i <= (y) ; ++i)
#define ROF(i,x,y) for(vlong i = (y) ; i >= (x) ; --i)
#define CLR(x,y) memset(x,y,sizeof(x))
#define UNIQUE(V) (V).erase(unique((V).begin(),(V).end()),(V).end())
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
#define NUMDIGIT(x,y) (((vlong)(log10((x))/log10((y))))+1)
#define SQ(x) ((x)*(x))
#define ABS(x) ((x)<0?-(x):(x))
#define FABS(x) ((x)+eps<0?-(x):(x))
#define ALL(x) (x).begin(),(x).end()
#define LCM(x,y) (((x)/gcd((x),(y)))*(y))
#define SZ(x) ((vlong)(x).size())
#define NORM(x) if(x>=mod)x-=mod;
using namespace std;
typedef long long vlong;
int arr[1000010];
int main () {
int kase;
scanf ( "%d", &kase );
int cnt = 0;
while ( kase-- ) {
int n, k;
scanf ( "%d %d", &n, &k );
FOR(i,0,n-1) {
scanf ( "%d", &arr[i] );
arr[i] *= -1;
}
FOR(i,0,n-1) {
int t;
scanf ( "%d", &t );
arr[i] += t;
}
///arr[i] contains ( what that shop gives shamsu - what shamsu gives to godfather)
vlong res = 0;
sort ( arr, arr + n ); ///Now, losses come first and profit comes later.
FOR(i,0,n-1) {
if ( arr[i] < 0 ) { ///This is a loss
if ( k ) { ///I can still skip loss
k--;
continue;
}
}
res += arr[i];
}
printf ( "Case %d: ", ++cnt );
if ( res <= 0 ) printf ( "No Profit\n" );
else printf ( "%lld\n", res );
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CgojZGVmaW5lIHBiIHB1c2hfYmFjawojZGVmaW5lIG5sIHB1dHMgKCIiKQojZGVmaW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1vZDsKCnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0eXBlZGVmIGxvbmcgbG9uZyB2bG9uZzsKCmludCBhcnJbMTAwMDAxMF07CgppbnQgbWFpbiAoKSB7CgogICAgaW50IGthc2U7CiAgICBzY2FuZiAoICIlZCIsICZrYXNlICk7CgogICAgaW50IGNudCA9IDA7CiAgICB3aGlsZSAoIGthc2UtLSApIHsKICAgICAgICBpbnQgbiwgazsKICAgICAgICBzY2FuZiAoICIlZCAlZCIsICZuLCAmayApOwoKICAgICAgICBGT1IoaSwwLG4tMSkgewogICAgICAgICAgICBzY2FuZiAoICIlZCIsICZhcnJbaV0gKTsKICAgICAgICAgICAgYXJyW2ldICo9IC0xOwogICAgICAgIH0KCiAgICAgICAgRk9SKGksMCxuLTEpIHsKICAgICAgICAgICAgaW50IHQ7CiAgICAgICAgICAgIHNjYW5mICggIiVkIiwgJnQgKTsKICAgICAgICAgICAgYXJyW2ldICs9IHQ7CiAgICAgICAgfQoKICAgICAgICAvLy9hcnJbaV0gY29udGFpbnMgKCB3aGF0IHRoYXQgc2hvcCBnaXZlcyBzaGFtc3UgLSB3aGF0IHNoYW1zdSBnaXZlcyB0byBnb2RmYXRoZXIpCgogICAgICAgIHZsb25nIHJlcyA9IDA7CiAgICAgICAgc29ydCAoIGFyciwgYXJyICsgbiApOyAvLy9Ob3csIGxvc3NlcyBjb21lIGZpcnN0IGFuZCBwcm9maXQgY29tZXMgbGF0ZXIuCgogICAgICAgIEZPUihpLDAsbi0xKSB7CiAgICAgICAgICAgIGlmICggYXJyW2ldIDwgMCApIHsgLy8vVGhpcyBpcyBhIGxvc3MKICAgICAgICAgICAgICAgIGlmICggayApIHsgLy8vSSBjYW4gc3RpbGwgc2tpcCBsb3NzCiAgICAgICAgICAgICAgICAgICAgay0tOwogICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIHJlcyArPSBhcnJbaV07CiAgICAgICAgfQoKICAgICAgICBwcmludGYgKCAiQ2FzZSAlZDogIiwgKytjbnQgKTsKICAgICAgICBpZiAoIHJlcyA8PSAwICkgcHJpbnRmICggIk5vIFByb2ZpdFxuIiApOwogICAgICAgIGVsc2UgcHJpbnRmICggIiVsbGRcbiIsIHJlcyApOwogICAgfQoKICAgIHJldHVybiAwOwp9Cg==