Buggy python submission (verdict: Time Limit Exceeded):
while 1:
  h,w=map(int,raw_input().split())
  if h==w==0: break
  a=[0]*w
  F=[]
  for _ in [0]*h:
    b=raw_input()
    f=[0]*w
    for i in range(w):
      f[i]=[a[i]+1,0][b[i]=="*"]
    F.append(f)
    a=f

  s=0
  for i in range(h):
    f=F[i]
    for j in range(w):
      m=1e9
      for k in range(j+1,w+1):
        m=min(f[j:k])
        s=max(s,m*(k-j))
  print s

Fixed submission:
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s

Buggy python submission (verdict: Time Limit Exceeded):
while 1:
  h,w=map(int,raw_input().split())
  if h==w==0: break
  W=range(w)
  a=[0]*w
  s=0
  for _ in [0]*h:
    b=raw_input()
    f=[0]*w
    for i in W:
      f[i]=[a[i]+1,0][b[i]=="*"]
      m=1e9
      for j in range(i+1):
        m=min(f[j:i+1])
        if m!=0: s=max(s,m*(i+1-j))
    a=f
  print s

Fixed submission:
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s

Buggy python submission (verdict: Runtime Error):
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  A = []
  for i in range(h):
    A.append(map(int,list(raw_input().replace(".", "1").replace("*", "0"))))
  B = A[:]
  C = []
  for j in range(1,h):
    m=[]
    for i in range(j,h):
      x=[e1&e2 for e1,e2 in zip(B[i-j],A[i])]
      B[i-j]=x
      m.append(max("".join(map(str,x)).split("0")))
    C.append(len(max(m))*(j+1))
  print max(C)

Fixed submission:
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s

Buggy python submission (verdict: Runtime Error):
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  A = []
  for i in range(h):
    A.append(map(int, list(raw_input().replace(".", "1").replace("*", "0"))))
  B = A[:]
  C = []
  for j in range(1,h):
    m=[]
    for i in range(j,h):
      x = [e1 & e2 for e1, e2 in zip(B[i-j], A[i])]
      B[i-j] = x
      m.append(max("".join(map(str, x)).split("0")))
    C.append(len(max(m))*(j+1))
  print max(C)

Fixed submission:
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s

Buggy python submission (verdict: Runtime Error):
import sys
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  A = []
  for _ in [0]*h:
    A.append(map(int, list(raw_input().replace(".", "1").replace("*", "0"))))
  B = A[:]
  C = []
  for j in range(1,h):
    m=[]
    for i in range(j,h):
      x = [e1 & e2 for e1, e2 in zip(B[i-j], A[i])]
      B[i-j] = x
      m.append(max("".join(map(str, x)).split("0")))
    C.append(len(max(m))*(j+1))
  print max(C)

Fixed submission:
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s

Buggy python submission (verdict: Runtime Error):
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  A = [0]*h
  for i in range(h):
    x = raw_input().replace(".", "1").replace("*", "0")
    A[i] = map(int, list(x))
  B = A[:]
  C = []
  for j in range(1,h):
    M = []
    for i in range(j,h):
      x = [e1 & e2 for e1, e2 in zip(B[i-j], A[i])]
      B[i-j] = x
      M.append(sorted("".join(map(str, x)).split("0"))[-1])
    C.append(len(sorted(M)[-1])*(j+1))
  print max(C)

Fixed submission:
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s

Buggy python submission (verdict: Time Limit Exceeded):
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  H = range(h)
  A = [0]*h
  for i in H:
    x = raw_input().replace(".", "1").replace("*", "0")
    A[i] = map(int, list(x))
  B = A[:]
  C = [0]*h
  for j in H[1:]:
    M = ["1","11","111"]
    for i in H[j:]:
      x = [e1 & e2 for e1, e2 in zip(B[i-j], A[i])]
#      B[i-j] = x
#      M.append(sorted("".join(map(str, x)).split("0"))[-1])
    C[j] = len(sorted(M)[-1])*(j+1)
  print max(C)

Fixed submission:
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s

Buggy python submission (verdict: Time Limit Exceeded):
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  H = range(h)
  A = [0]*h
  for i in H:
    x = raw_input().replace(".", "1").replace("*", "0")
    A[i] = map(int, list(x))
  B = A[:]
  C = [0]*h
  for j in H[1:]:
    M = ["1","11","111"]
    for i in H[j:]:
      x = [e1 & e2 for e1, e2 in zip(B[i-j], A[i])]
      B[i-j] = x[:]
#      M.append(sorted("".join(map(str, x)).split("0"))[-1])
    C[j] = len(sorted(M)[-1])*(j+1)
  print max(C)

Fixed submission:
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s

Buggy python submission (verdict: Time Limit Exceeded):
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  H = range(h)
  A = [0]*h
  for i in H:
    x = raw_input().replace(".", "1").replace("*", "0")
    A[i] = map(int, list(x))
  B = A[:]
  C = [0]*h
  for j in H[1:]:
    M = ["1","11","111"]
    for i in H[j:]:
      x = [e1 & e2 for e1, e2 in zip(B[i-j], A[i])]
      B[i-j] = x[:]
      x=sorted("".join(map(str, x)).split("0"))
#      M.append(x[-1])
    C[j] = len(sorted(M)[-1])*(j+1)
  print max(C)

Fixed submission:
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s

Buggy python submission (verdict: Time Limit Exceeded):
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  H = range(h)
  A = [0]*h
  for i in H:
    x = raw_input().replace(".", "1").replace("*", "0")
    A[i] = map(int, list(x))
  B = A[:]
  C = [0]*h
  for j in H[1:]:
    M = ["1","11","111"]
    for i in H[j:]:
      x = [e1 * e2 for e1, e2 in zip(B[i-j], A[i])]
      B[i-j] = x[:]
      x=sorted("".join(map(str, x)).split("0"))
#      M.append(x[-1])
    C[j] = len(sorted(M)[-1])*(j+1)
  print max(C)

Fixed submission:
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s

Buggy python submission (verdict: Time Limit Exceeded):
def f(k,j): return max(M[k],j-C[k])
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  H = range(h)
  C = [0]*(h+1)
  M = C[:]
  a=[0]*w
  for i in H:
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*":
        c=0
      elif x[j]==".":
        c=a[j]+1
      b[j]=c
      if c>sp:
        C[sp+1:c+1]=[j]*(c-sp)
      elif c<sp:
        for k in range(c+1,sp+1):
          M[k]=f(k,j)
          C[k]=-1
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0:
        M[k]=f(k,w)
    a=b
  s=max([a*b for a,b in zip(M, H+[h])])
  print s

Fixed submission:
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s

Buggy python submission (verdict: Runtime Error):
def f(j,k):
  tmp=j-C[k]
  if tmp>M[k]: M[k]
  return

while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): f(j,k)
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([M[i]*i for i in range(h+1) if M[i]>0])
  print s

Fixed submission:
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s

Buggy python submission (verdict: Runtime Error):
def f(j,k):
  tmp=j-C[k]
  if tmp>M[k]: M[k]=tmp
  return

while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): f(j,k)
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([M[i]*i for i in range(h+1) if M[i]>0])
  print s

Fixed submission:
while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s