Artifact d12dbd8cea2ce4313abe72ef606026ea5862b36e
- File
SRM/146/1A.cpp
- 2011-02-23 09:21:16 - part of checkin [4fd800b3a8] on branch trunk - Copied from private svn repository. (user: kinaba) [annotate]
using namespace std; struct RectangularGrid { long long countRectangles(int width, int height) { long long w = width+1; long long h = height+1; long long s = w*(w-1)/2*h*(h-1)/2; for(long long x=1; x<w && x<h; ++x) s -= (w-x)*(h-x); return s; } };