log in
About and Contact
© 2020 DOUBTCOOL
Hey check out my code if you want to solve this problem by swapping of variables.....
def OddN(o,n2,n1): k1 = o//2 d = n2*(2**k1) k2 = o-k1 c = n1*(2**k2) ans = max(c,d)//min(c,d) print(ans) def EvenN(o,n2,n1): k = o//2 c = n2*(2**k) d = n1*(2**k) ans = max(c,d)//min(c,d) print(ans) t = int(input()) for _ in range(t): a,b,n=map(int,input().split()) if n%2!=0: OddN(n,b,a) elif n%2==0: EvenN(n,b,a)