Make algorithm faster python. Run time error

I need to find average of sum of consequtive elements from list.
At first I am given lenght of list,

then list with numbers,

then am given how many test i need to perform(several rows with inputs),

then I am given several inputs to perform tests(and need to print as many rows with results)

every row for test consist of start and end element in list.

My algorithm:

nu = int(input()) # At first I am given lenght of list
numbers = input().split() # then list with numbers
num = input() # number of rows with inputs
k =[float(i) for i in numbers] # given that numbers in list are of float type
i= 0
while i < int(num):
a,b = input().split() # start and end element in list
i += 1
print(round(sum(k[int(a):(int(b)+1)])/(-int(a)+int(b)+1),6)) # round up t0 6 decimals

Example:
Input:
8 - len(list)
79.02 36.68 79.83 76.00 95.48 48.84 49.95 91.91 - list
10 - number of test
0 0 - a1,b1
0 1
0 2
0 3
0 4
0 5
0 6
0 7
1 7
2 7
Output:
79.020000
57.850000
65.176667
67.882500
73.402000
69.308333
66.542857
69.713750
68.384286
73.668333

Done.