I am not able to identify my mistake here. Problem is that when i submit my code test-case 1 shows time-limit error so i downloaded test-case 1 and gave input as it was in the test-case 1. So by giving custom input i get correct answer but when i submit the code it shows time-limit error. /*
Test-case 1 is as follows
Input :
4
1 100
0 1000
33 99
44 1500
Output :
25
168
14
225
*/