TAX SLABS LOGIC

T = int(input())
l = [250000 * i for i in range(1,7)]
s = 0
while T > 0:
N = int(input())
if N//100 <= 2500:
print(N)
else:
for i in range(1,len(l)):
k = (i*5)/100
if N < l[i]:
s += int((N-l[i-1])*k)
break
else:
s += int((l[i]-l[i-1])*k)

    if N > l[-1]:
        N_S = N - int(s+(N-l[-1])*.30)
    else:
        N_S = N - s
    
    print(N_S)
T-=1

Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

1 Like

Ok this is the link to submission
https://www.codechef.com/viewsolution/30250949