{ll@q;rep(q){ll@n,@i,@j,k=2min({i,++j,n-i,n-j});wt(k*(2n-k)+~(i