Maximal Color Rectangle
면접 대비시간 제한2초메모리 제한1024 MB
N x N 격자의 각 칸에 색 ID가 주어질 때, 모든 칸이 같은 색인 가장 큰 축에 나란한 직사각형의 넓이를 구한다.
문제
You are given an grid where each cell contains an integer color ID . Your task is to find the largest axis-aligned rectangle whose cells all have the same color, and report its area.

In this figure, the maximal area satisfying the problem’s conditions is . Note that rectangle must be axis-aligned and contiguous in rows and columns.
입력
The first line contains a single integer , representing the size of the grid .
The next lines each contain integers, integer denotes the color ID .
출력
Print a single integer: the maximal area satisfying the problem’s conditions.