import math
n= int(input())
for i in range(n):
N,M=input().split()
N=int(N)
M=int(M)
suma_ilosc_ciastek=0
for j in range(N):
czas=input()
czas=int(czas)
doba=3600*24
zjedzone_ciastka=doba//czas
suma_ilosc_ciastek+=zjedzone_ciastka
ilosc_pudelek=math.ceil(suma_ilosc_ciastek/M)
print(ilosc_pudelek)
aW1wb3J0IG1hdGgKCm49IGludChpbnB1dCgpKQoKZm9yIGkgaW4gcmFuZ2Uobik6CglOLE09aW5wdXQoKS5zcGxpdCgpCglOPWludChOKQoJTT1pbnQoTSkKCXN1bWFfaWxvc2NfY2lhc3Rlaz0wCglmb3IgaiBpbiByYW5nZShOKToKCQljemFzPWlucHV0KCkKCQljemFzPWludChjemFzKQoJCWRvYmE9MzYwMCoyNAoJCXpqZWR6b25lX2NpYXN0a2E9ZG9iYS8vY3phcwoJCXN1bWFfaWxvc2NfY2lhc3Rlays9emplZHpvbmVfY2lhc3RrYQoJaWxvc2NfcHVkZWxlaz1tYXRoLmNlaWwoc3VtYV9pbG9zY19jaWFzdGVrL00pCglwcmludChpbG9zY19wdWRlbGVrKQ==