t=int(input())
while t:
t-=1
n,m=map(int,input().split())
print((n-1)*(m-1))
while t
here makes me confused , is it always true ? i have no idea to describe it.I have never seen this .Could you explain what is going on here with explaination , please ,thank you!
t-=1
. It will exit when it reaches 0.