Avoid unnecessary splitting start and end number in inner loop. Got 9/10 TLE. This solution won't work because the number of test cases is increased from 6 to 10000 after migrating to hacker rank.