|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|5 초||512 MB||10||8||7||77.778%|
You have just bought land and want to plant the largest rectangular field possible. In surveying your land, you find a number of obstacles and decide to draw a map. You indicate in each square of the map whether it contains grass (G), rock (R), water (W), shrubs (S), or trees (T). While the grass can be mowed and the shrubs dug from the ground, the water, rocks, and trees cannot be removed. Given these obstacles, determine the area of the largest rectangular field.
The first line of input gives the number of cases, N.
N test cases follow. For each test case there will be:
G, R, W, S, or T).
For each test case, output one line containing "Case #x: " followed by the maximum area of the largest rectangle that can be cleared.
4 1 1 G 2 2 GS SG 2 2 GT GG 5 8 GGTGG TGGGG GSSGT GGGGT GWGGG RGTRT RTGWT WTWGR
Case #1: 1 Case #2: 4 Case #3: 2 Case #4: 9