the average runs scored by a batsman in 20 matches is 40 . in the next 10 matches the batsman scored an average of 30 runs . find his average in all the 30 matches ?
n0 = 20.0
n1 = 40.0
n2 = 10.0
n3 = 30.0
n4 = 30.0
t0 = n0 + n2
t1 = n0 * n1
t2 = n2 * n3
t3 = t1 + t2
answer = t3 / t0
print(answer)