原来n×m的方格,涂去r行还剩(n-r)×m个,再把c列涂去,答案为(n-r)×(m-c)
#include<cstdio> using namespace std; int main(){ long long n,m,r,c; while(~scanf("%lld %lld %lld %lld",&n,&m,&r,&c)) printf("%lld\n",(n-r)*(m-c)); }
原来n×m的方格,涂去r行还剩(n-r)×m个,再把c列涂去,答案为(n-r)×(m-c)
#include<cstdio> using namespace std; int main(){ long long n,m,r,c; while(~scanf("%lld %lld %lld %lld",&n,&m,&r,&c)) printf("%lld\n",(n-r)*(m-c)); }