Artifact Content
Not logged in

Artifact d12dbd8cea2ce4313abe72ef606026ea5862b36e


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;
	}
};