ll@N,@M; double @P; if(N==1) { if(M==1) { wt(P); } else { wt(P*P*2+P**3*(M-2)); } } else if(M==1) { wt(P*P*2+P**3*(N-2)); } else { wt(P**3*4+P**4*((N-2)*2+(M-2)*2)+P**5*(N-2)*(M-2)); }