Chechoc from july lunchtime

a=int(input())
lstf=[]
for i in range(a):
d=[int(j) for j in input().split()]
lstf.append(d)
for i in lstf:
totalbox=i[0]i[1]
if(i[0]==1 and i[1]==1):
print(i[2])
continue
if(i[3]%2==0):
if(i[3]//2<=i[2]):
val=i[3]//2
print(totalbox
val)
else:
val=i[2]
print(totalbox*val)
else:
if((i[3]//2)+1<=i[2]):
val1=(i[3]//2)+1
val2=i[3]//2
if(totalbox%2==0):
ans=((totalbox//2)*val1)+((totalbox//2)*val2)
print(ans)
else:
ans1=(totalbox//2)*val2
ans2=((totalbox//2)+1)val1
print(ans1+ans2)
else:
val1=i[2]
print(totalbox
val1)

can someone tell me whats the error in my code? in my knowledge it is working for all the test cases i can think of but ans was not accepted. pls help thanks

two suggestions which worked for everyone, check for 1x1 matrix and also when y<x.
1 1 10 8
ans - 10
2 3 5 2
ans - 6