#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t; cin >> t;
while(t-->0) {
int n,x; cin >> n >> x;
vector<int> a(n);
int max_n=0; int sum=0;
for(int i=0;i<n;++i) {
cin >> a[i];
max_n=max(max_n,a[i]);
sum+=a[i];
}
int result=max(max_n,(sum+x-1)/x);
cout << result << "\n";
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKICAgIGludCB0OyBjaW4gPj4gdDsKICAgIHdoaWxlKHQtLT4wKSB7CiAgICAgICAgaW50IG4seDsgY2luID4+IG4gPj4geDsKICAgICAgICB2ZWN0b3I8aW50PiBhKG4pOwogICAgICAgIGludCBtYXhfbj0wOyBpbnQgc3VtPTA7CiAgICAgICAgZm9yKGludCBpPTA7aTxuOysraSkgewogICAgICAgICAgICBjaW4gPj4gYVtpXTsKICAgICAgICAgICAgbWF4X249bWF4KG1heF9uLGFbaV0pOwogICAgICAgICAgICBzdW0rPWFbaV07CiAgICAgICAgfQogICAgICAgIGludCByZXN1bHQ9bWF4KG1heF9uLChzdW0reC0xKS94KTsKICAgICAgICBjb3V0IDw8IHJlc3VsdCA8PCAiXG4iOwogICAgfQoJcmV0dXJuIDA7Cn0=