#include<bits/stdc++.h> using namespace std; long long n,m,nn,mm,zfx,cfx;//n、m为长宽 int main() { cin>>n>>m; nn=n; mm=m; while(mm>=1 && nn>=1) { zfx+=mm*nn; nn--; mm--; } cfx=n*(n+1)*m*(m+1)/4-zfx; cout<<zfx<<" "<<cfx; return 0; }
标签:zfx,nn,mm,长方形,long,正方形,枚举,cfx,-- From: https://www.cnblogs.com/fc2110rxr/p/17232469.html