#Jelly, 14 bytes

2 bytes thanks to Dennis.

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

[Try it online!](http://jelly.tryitonline.net/#code=UuKAmCrigqzCuSQrWiRG4bmiUeG7i0A&input=&args=OTc&debug=on) (Takes ~ 1s for 82 for me) (O(n^2) time)

### Original 16-byte answer

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

[Try it online!](http://jelly.tryitonline.net/#code=MnIzMCrigqzCuSQrWiRG4bmiUeG7i0A&input=&args=ODI) (Takes < 1s for me) (Constant time)