def ileCiastekZjeObzartuch( number) :
return math .floor ( 24 *3600 /number)
ileCiastek= [ ]
wynik= [ ]
inp= int ( input ( ) )
counterTable= [ ]
for item in range ( inp) :#ile przypadkow
numbers= input ( ) .split ( )
for i in range ( int ( numbers[ 0 ] ) ) :#ile obzartuchow
sum = 0
obzartuchTempo = int ( input ( ) )
ileCiastek.append ( ileCiastekZjeObzartuch( obzartuchTempo) )
for it in ileCiastek:
sum += it
ileCiastek= [ ]
wynik.append ( math .ceil ( sum /int ( numbers[ 1 ] ) ) )
for item in wynik:
print ( item)
ZGVmIGlsZUNpYXN0ZWtaamVPYnphcnR1Y2gobnVtYmVyKToKICAgIHJldHVybiBtYXRoLmZsb29yKDI0KjM2MDAvbnVtYmVyKQppbGVDaWFzdGVrPVtdCnd5bmlrPVtdCmlucD1pbnQoaW5wdXQoKSkKY291bnRlclRhYmxlPVtdCmZvciBpdGVtIGluIHJhbmdlKGlucCk6I2lsZSBwcnp5cGFka293CiAgICBudW1iZXJzPWlucHV0KCkuc3BsaXQoKQogICAgZm9yIGkgaW4gcmFuZ2UoaW50KG51bWJlcnNbMF0pKTojaWxlIG9iemFydHVjaG93CiAgICAgICAgc3VtPTAKICAgICAgICBvYnphcnR1Y2hUZW1wbyA9IGludChpbnB1dCgpKQogICAgICAgIGlsZUNpYXN0ZWsuYXBwZW5kKGlsZUNpYXN0ZWtaamVPYnphcnR1Y2gob2J6YXJ0dWNoVGVtcG8pKQogICAgZm9yIGl0IGluIGlsZUNpYXN0ZWs6CiAgICAgICAgc3VtKz1pdAogICAgaWxlQ2lhc3Rlaz1bXQogICAgd3luaWsuYXBwZW5kKG1hdGguY2VpbChzdW0vaW50KG51bWJlcnNbMV0pKSkKZm9yIGl0ZW0gaW4gd3luaWs6CiAgICBwcmludChpdGVtKQ==