2 of 3 deleted 14 characters in body

Jelly, 14 bytes

2 bytes thanks to Dennis.

R‘*€¹$+Z$FṢQị@

Try it online! (Takes 0m0.950s for me) (Constant time)

Original 16-byte answer

2r30*€¹$+Z$FṢQị@

Try it online! (Takes 0.947s for me) (Constant time)