My issue
I cant understand how to apply the logic to this given statement.please give me the way how to apply it
My code
# Update the code below to solve this problem
import math
t = int(input())
for i in range(t):
N, X = map(int, input().split())
salary=math.pow(2,X)
if N==1:
spent=salary/2
savings=salary-spent
print(int(savings))
elif N==2:
spent=salary/2
spent1=spent/2
savings=salary-spent1
print(int(savings))
elif N==2:
spent=salary/2
spent1=spent/2
spent2=spent1/2
savings=salary-spent2
print(int(savings))
elif N==3:
spent=salary/2
spent1=spent/2
spent2=spent1/2
spent3=spent2/2
savings=salary-spent3
print(int(savings))
Learning course: Python with Data structures
Problem Link: CodeChef: Practical coding for everyone