BURGER - Editorial

t=int(input())

for i in range(t):
    x,y=[int(j) for j in input().split()]
    c=0
    tmpx=x
    if x>y:
        c=-1
    else:
      while y>0:
        if x<=y:
          y=y-x
          x*=2
        else:
          x=tmpx
          if x>y:
            c=-1
            break
          y=y-x
          x*=2
          c+=1
        c+=1
    print(c)

Why this code give wrong answer? Is there only one way to solve this problem.

1 8589934591
i think using builtinpop_countll should be used for long long int

Nice solution. Learnt a lot. What would our approach had been if the streaks didn’t have to be distinct? Any help would be appreciated.