Jane Street interview question

hard mental math