#define MAX(a, b) (((a) < (b)) ? (b) : (a))
#define MIN(a, b) (((a) > (b)) ? (b) : (a))
int maxArea(int *height, int heightSize)
{
	int max = 0;
	int i = 0, j = heightSize - 1;
	int a;
	while (i < j)
	{
		a = MIN(height[i], height[j]) * (j - i);
		max = MAX(max, a);
		if (height[i] > height[j])
			--j;
		else
			++i;
	}
	return max;
}