The average is defined as the sum of all the numbers divided (integer division) by the total numbers that are included to determine the average. Therefore, your task is to determine the average of all naturals number from L to R both inclusive.

Input 

3
3 8
0 10
1234 5678

Output 
 
   5
5
3456

       
 Solution

t=int(input())
for i in range(t):
a,b=map(int,input().split())
ans=(a+b)//2

print(ans)




if you have any problem in this code, take a screenshot and contact with Rishabh Chaubey.

Post a Comment

Previous Post Next Post