don't mention it
i've got 0.01 on first run of my code
and on the second i've got 0.04 with the same code
but you can optimize your code using:
1. form data with
map(int, sys.stdin.read().split())
- you know how many lines are in the input so just copy and paste your code ten times
- use
import gc; gc.disable()
at the start