Buggy python submission (verdict: Time Limit Exceeded):
def dotHeight(y,x):
    cnt=0
    for i in range(y,-1,-1):
        if L[i][x]=="*":
            return cnt
        cnt+=1

def dotLength(y,x):
    cnt=0
    for i in range(x,-1,-1):
        if L[y][i]=="*":
            return cnt
        cnt+=1

while True:
    H,W=map(int,raw_input().split())
    if H==W==0:break
    L=[["*"]+list(raw_input())+["*"] for i in range(H)]
    L.append(["*"]*(W+2))
    L.insert(0,["*"]*(W+2))
    dp=[[set() for i in range(W+2)] for i in range(H+2)]
    maxInt=0
    for i in range(1,H+2):
        for j in range(1,W+2):
            if L[i][j]==".":
                if L[i-1][j]==L[i][j-1]=="*":
                    dp[i][j].add((1,1))
                    maxInt=max(maxInt,1)
                elif L[i-1][j]=="*":
                    for k in dp[i][j-1]:
                        dp[i][j].add((k[0]+1,1))
                        maxInt=max(maxInt,k[0]+1)
                elif L[i][j-1]=="*":
                    for k in dp[i-1][j]:
                        dp[i][j].add((1,k[1]+1))
                        maxInt=max(maxInt,k[1]+1)
                else:
                    h=dotHeight(i,j)
                    l=dotLength(i,j)
                    for k in dp[i][j-1]:
                        dp[i][j].add((k[0]+1,min(k[1],h)))
                        maxInt=max(maxInt,(k[0]+1)*min(k[1],h))
                    for k in dp[i-1][j]:
                        dp[i][j].add((min(k[0],l),k[1]+1))
                        maxInt=max(maxInt,min(k[0],l)*(k[1]+1))
        dp[i-1]=[]
    print maxInt

Fixed submission:
def histogram(mass, h, w):
    table = [[0]*w for i in range(h)]
    for i in range(h):
        for j in range(w):
            if mass[i][j] == '*':
                table[i][j] = 0
            else:
                table[i][j] = table[i-1][j] + 1
    return table


def get_rectangle_area(table, w):
    maxv = 0
    stack = []
    table.append(0)
    for i, rect in enumerate(table):
        if stack == []:
            stack.append((rect, i))
        elif stack[-1][0] < rect:
            stack.append((rect, i))
        elif stack[-1][0] == rect:
            pass
        elif stack[-1][0] > rect:
            while stack != [] and stack[-1][0] >= rect:
                high, pos = stack.pop()
                maxv = max(maxv, high*(i-pos))
            stack.append((rect, pos))
    return maxv

while True:
    h, w = map(int, raw_input().split())
    if h == w == 0:
        break
    mass = [raw_input() for i in range(h)]
    table = histogram(mass, h, w)
    ans = 0
    for tab in table:
        ans = max(ans, get_rectangle_area(tab, w))
    print ans

Buggy python submission (verdict: Time Limit Exceeded):
while True:
    H,W=map(int,raw_input().split())
    if H==W==0:break
    L=[["*"]+list(raw_input())+["*"] for i in range(H)]
    L.append(["*"]*(W+2))
    L.insert(0,["*"]*(W+2))
    dp=[[set() for i in range(W+2)] for i in range(H+2)]
    T=[[[0,0] for i in range(W+2)] for i in range(H+2)]
    for i in range(1,H+1):
        for j in range(1,W+1):
            if L[i][j]==".":
                T[i][j][0]+=T[i][j-1][0]+1
                T[i][j][1]+=T[i-1][j][1]+1
    maxInt=0
    for i in range(1,H+2):
        for j in range(1,W+2):
            if L[i][j]==".":
                if L[i-1][j]==L[i][j-1]=="*":
                    dp[i][j].add((1,1))
                    maxInt=max(maxInt,1)
                elif L[i-1][j]=="*":
                    for k in dp[i][j-1]:
                        dp[i][j].add((k[0]+1,1))
                        maxInt=max(maxInt,k[0]+1)
                elif L[i][j-1]=="*":
                    for k in dp[i-1][j]:
                        dp[i][j].add((1,k[1]+1))
                        maxInt=max(maxInt,k[1]+1)
                else:
                    h=T[i][j][1]
                    l=T[i][j][0]
                    for k in dp[i][j-1]:
                        m=min(k[1],h)
                        dp[i][j].add((k[0]+1,m))
                        maxInt=max(maxInt,(k[0]+1)*m)
                    for k in dp[i-1][j]:
                        m=min(k[0],l)
                        dp[i][j].add((m,k[1]+1))
                        maxInt=max(maxInt,m*(k[1]+1))
        dp[i-1]=[]
    print maxInt

Fixed submission:
def histogram(mass, h, w):
    table = [[0]*w for i in range(h)]
    for i in range(h):
        for j in range(w):
            if mass[i][j] == '*':
                table[i][j] = 0
            else:
                table[i][j] = table[i-1][j] + 1
    return table


def get_rectangle_area(table, w):
    maxv = 0
    stack = []
    table.append(0)
    for i, rect in enumerate(table):
        if stack == []:
            stack.append((rect, i))
        elif stack[-1][0] < rect:
            stack.append((rect, i))
        elif stack[-1][0] == rect:
            pass
        elif stack[-1][0] > rect:
            while stack != [] and stack[-1][0] >= rect:
                high, pos = stack.pop()
                maxv = max(maxv, high*(i-pos))
            stack.append((rect, pos))
    return maxv

while True:
    h, w = map(int, raw_input().split())
    if h == w == 0:
        break
    mass = [raw_input() for i in range(h)]
    table = histogram(mass, h, w)
    ans = 0
    for tab in table:
        ans = max(ans, get_rectangle_area(tab, w))
    print ans

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding:utf-8 -*-

def histgram(mass, h, w):
    table = [[0]*w for i in range(h)]
    for i in range(h):
        for j in range(w):
            if mass[i][j] == '*':
                table[i][j] = 0
            else:
                table[i][j] = table[i-1][j] + 1
    return table

def get_rectangle_area(table, w):
    maxv = 0
    for i in range(w):
        for j in range(i, w):
            minh = 1000000
            for k in range(i, j+1):
                minh = min(minh, table[k])
            maxv = max(maxv, minh*(j-i+1))
    return maxv

while True:
    h, w = map(int, raw_input().split())
    if h == w == 0:
        break
    mass = [raw_input() for i in range(h)]
    table = histgram(mass, h, w)
    ans = 0
    for tab in table:
        ans = max(ans, get_rectangle_area(tab, w))
    print ans

Fixed submission:
def histogram(mass, h, w):
    table = [[0]*w for i in range(h)]
    for i in range(h):
        for j in range(w):
            if mass[i][j] == '*':
                table[i][j] = 0
            else:
                table[i][j] = table[i-1][j] + 1
    return table


def get_rectangle_area(table, w):
    maxv = 0
    stack = []
    table.append(0)
    for i, rect in enumerate(table):
        if stack == []:
            stack.append((rect, i))
        elif stack[-1][0] < rect:
            stack.append((rect, i))
        elif stack[-1][0] == rect:
            pass
        elif stack[-1][0] > rect:
            while stack != [] and stack[-1][0] >= rect:
                high, pos = stack.pop()
                maxv = max(maxv, high*(i-pos))
            stack.append((rect, pos))
    return maxv

while True:
    h, w = map(int, raw_input().split())
    if h == w == 0:
        break
    mass = [raw_input() for i in range(h)]
    table = histogram(mass, h, w)
    ans = 0
    for tab in table:
        ans = max(ans, get_rectangle_area(tab, w))
    print ans

Buggy python submission (verdict: Runtime Error):
def get_rectangle_area(table, w):
    maxv = 0
    stack = []
    table.append(0)
    for i, rect in enumerate(table):
        if stack == []:
            stack.append((rect, i))
        elif stack[-1][0] < rect:
            stack.append((rect, i))
        elif stack[-1][0] == rect:
            pass
        elif stack[-1][0] > rect:
            while stack != [] and stack[-1][0] >= rect:
                high, pos = stack.pop()
                maxv = max(maxv, high*(i-pos))
            stack.append((rect, pos))
    return maxv

while True:
    h, w = map(int, raw_input().split())
    if h == w == 0:
        break
    mass = [raw_input() for i in range(h)]
    table = histgram(mass, h, w)
    ans = 0
    for tab in table:
        ans = max(ans, get_rectangle_area(tab, w))
    print ans

Fixed submission:
def histogram(mass, h, w):
    table = [[0]*w for i in range(h)]
    for i in range(h):
        for j in range(w):
            if mass[i][j] == '*':
                table[i][j] = 0
            else:
                table[i][j] = table[i-1][j] + 1
    return table


def get_rectangle_area(table, w):
    maxv = 0
    stack = []
    table.append(0)
    for i, rect in enumerate(table):
        if stack == []:
            stack.append((rect, i))
        elif stack[-1][0] < rect:
            stack.append((rect, i))
        elif stack[-1][0] == rect:
            pass
        elif stack[-1][0] > rect:
            while stack != [] and stack[-1][0] >= rect:
                high, pos = stack.pop()
                maxv = max(maxv, high*(i-pos))
            stack.append((rect, pos))
    return maxv

while True:
    h, w = map(int, raw_input().split())
    if h == w == 0:
        break
    mass = [raw_input() for i in range(h)]
    table = histogram(mass, h, w)
    ans = 0
    for tab in table:
        ans = max(ans, get_rectangle_area(tab, w))
    print ans