x = int(input()) def power(a): b=0 while 3**b<=a: b += 1 return b moves=0 moves += power(j) print(moves+power(int(y[0])))
Standard input is empty
x = int(input()) def power(a): b=0 while 3**b<=a: b += 1 return b for i in range(x) : moves=0 y = input().split() for j in range(int(y[0]),int(y[1])+1): moves += power(j) print(moves+power(int(y[0])))