Help me in solving MANCODE problem

My issue

cook your dish here

for i in range(int(input())):
n=int(input())
if n==0:
print(0,0)
else:
max=0
min=0
i=1
while (i<=n):
if i%2==1:
max+=1
else:
min+=1
i+=1
print(max,min)

My code

# cook your dish here
for i in range(int(input())):
    n=int(input())
    if n==0:
        print(0,0)
    else:
        max=0
        min=0
        i=1
        while (i<=n):
            if i%2==1:
                max+=1
            else:
                min+=1
            i+=1
        print(max,min)
    

Problem Link: The Man Code Practice Coding Problem - CodeChef