Buggy python submission (verdict: Time Limit Exceeded):
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

def count_light(Gs, h, w):
    Gc = np.empty((h,w))
    for i, gs in enumerate(Gs):
        count = 0
        for j, s in enumerate(gs):
            if s == '#':
                count = 0
                Gc[i][j] = 0
            else:
                count += 1
                Gc[i][j] = count

    return Gc

Gs1 = np.asarray(S)
Gn1 = count_light(Gs1, H, W)

Gs2 = np.rot90(Gs1, k=1)
Gn2 = count_light(Gs2, W, H)

Gs3 = np.rot90(Gs2, k=1)
Gn3 = count_light(Gs3, H, W)

Gs4 = np.rot90(Gs3, k=1)
Gn4 = count_light(Gs4, W, H)

Gn2 = np.rot90(Gn2, k=-1)
Gn3 = np.rot90(Gn3, k=-2)
Gn4 = np.rot90(Gn4, k=-3)

Gsum = Gn1+Gn2+Gn3+Gn4
ans = int(np.max(Gsum)-3)
print(ans)


Fixed submission:
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

def count_light(Gs, h, w):
    Gc = np.empty((h,w))
    for i in range(w):
        if i == 0:
            Gc[:, i] = Gs[:, i]
        else:
            Gc[:, i] = (Gc[:, i-1] + 1) * Gs[:, i]

    return Gc

Gs1 = np.asarray(S) == "."
Gn1 = count_light(Gs1, H, W)

Gs2 = np.rot90(Gs1, k=1)
Gn2 = count_light(Gs2, W, H)

Gs3 = np.rot90(Gs2, k=1)
Gn3 = count_light(Gs3, H, W)

Gs4 = np.rot90(Gs3, k=1)
Gn4 = count_light(Gs4, W, H)

Gn2 = np.rot90(Gn2, k=-1)
Gn3 = np.rot90(Gn3, k=-2)
Gn4 = np.rot90(Gn4, k=-3)

Gsum = Gn1+Gn2+Gn3+Gn4
ans = int(np.max(Gsum)-3)
print(ans)

Buggy python submission (verdict: Runtime Error):
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

def count_light(Gs, h, w):
    Gc = np.empty((h,w))
    for i, gs in enumerate(Gs):
        count = 0
        for j, s in enumerate(gs):
            if s == '#':
                count = 0
                Gc[i][j] = 0
            else:
                count += 1
                Gc[i][j] = count

    return Gc

Gs1 = np.asarray(S)
Gn1 = count_light(Gs1, H, W)

Gs2 = np.rot90(Gs, k=1)
Gn2 = count_light(Gs2, W, H)

Gs3 = np.rot90(Gs2, k=1)
Gn3 = count_light(Gs3, H, W)

Gs4 = np.rot90(Gs3, k=1)
Gn4 = count_light(Gs4, W, H)

Gn2 = np.rot90(Gn2, k=-1)
Gn3 = np.rot90(Gn3, k=-2)
Gn4 = np.rot90(Gn4, k=-3)

Gsum = Gn1+Gn2+Gn3+Gn4
ans = int(np.max(Gsum)-3)
print(ans)


Fixed submission:
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

def count_light(Gs, h, w):
    Gc = np.empty((h,w))
    for i in range(w):
        if i == 0:
            Gc[:, i] = Gs[:, i]
        else:
            Gc[:, i] = (Gc[:, i-1] + 1) * Gs[:, i]

    return Gc

Gs1 = np.asarray(S) == "."
Gn1 = count_light(Gs1, H, W)

Gs2 = np.rot90(Gs1, k=1)
Gn2 = count_light(Gs2, W, H)

Gs3 = np.rot90(Gs2, k=1)
Gn3 = count_light(Gs3, H, W)

Gs4 = np.rot90(Gs3, k=1)
Gn4 = count_light(Gs4, W, H)

Gn2 = np.rot90(Gn2, k=-1)
Gn3 = np.rot90(Gn3, k=-2)
Gn4 = np.rot90(Gn4, k=-3)

Gsum = Gn1+Gn2+Gn3+Gn4
ans = int(np.max(Gsum)-3)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

Gs = np.asarray(S)
Gs_ = np.rot90(Gs, k=1)

def count_light(Gs, h, w):
    Gc = np.empty((h,w))
    for i, gs in enumerate(Gs):
        count = 0
        gc = []
        for j, s in enumerate(gs):
            if s == '#':
                count = 0
                Gc[i][j] = 0
            else:
                count += 1
                Gc[i][j] = count

    Gn = np.empty((h,w))
    for i, gc in enumerate(Gc):
        count = -1
        gn = []
        for j, c in enumerate(reversed(gc)):
            if c == 0:
                count = -1
                Gn[i][w-j-1] = 0
            else:
                if count == -1:
                    count = c
                Gn[i][w-j-1]  = count

    return Gn

Gn = count_light(Gs, H, W)
Gn_ = count_light(Gs_, W, H)
Gn_ = np.rot90(Gn_, k=-1)

Gsum = Gn+Gn_
ans = np.max(Gsum)-1

        
print(int(ans))

Fixed submission:
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

def count_light(Gs, h, w):
    Gc = np.empty((h,w))
    for i in range(w):
        if i == 0:
            Gc[:, i] = Gs[:, i]
        else:
            Gc[:, i] = (Gc[:, i-1] + 1) * Gs[:, i]

    return Gc

Gs1 = np.asarray(S) == "."
Gn1 = count_light(Gs1, H, W)

Gs2 = np.rot90(Gs1, k=1)
Gn2 = count_light(Gs2, W, H)

Gs3 = np.rot90(Gs2, k=1)
Gn3 = count_light(Gs3, H, W)

Gs4 = np.rot90(Gs3, k=1)
Gn4 = count_light(Gs4, W, H)

Gn2 = np.rot90(Gn2, k=-1)
Gn3 = np.rot90(Gn3, k=-2)
Gn4 = np.rot90(Gn4, k=-3)

Gsum = Gn1+Gn2+Gn3+Gn4
ans = int(np.max(Gsum)-3)
print(ans)

Buggy python submission (verdict: Runtime Error):
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

Gs = np.asarray(S)
Gs_ = np.rot90(Gs, k=1)

def count_light(Gs, h, w):
    Gc = np.empty((h,w))
    for i, gs in enumerate(Gs):
        count = 0
        gc = []
        for j, s in enumerate(gs):
            if s == '#':
                count = 0
                Gc[i][j] = 0
            else:
                count += 1
                Gc[i][j] = count

    Gn = np.empty((h,w))
    for i, gc in enumerate(Gc):
        count = -1
        gn = []
        for j, c in enumerate(reversed(gc)):
            if c == 0:
                count = -1
                Gn[i][j] = 0
            else:
                if count == -1:
                    count = c
                Gn[i][w-j-1]  = count

    return Gn

Gn = count_light(Gs, H, W)
Gn_ = count_light(Gs_, W, H)
Gn_ = np.rot90(Gn_, k=-1)

Gsum = Gn+Gn_
ans = np.max(Gsum)-1

        
print(int(ans))

Fixed submission:
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

def count_light(Gs, h, w):
    Gc = np.empty((h,w))
    for i in range(w):
        if i == 0:
            Gc[:, i] = Gs[:, i]
        else:
            Gc[:, i] = (Gc[:, i-1] + 1) * Gs[:, i]

    return Gc

Gs1 = np.asarray(S) == "."
Gn1 = count_light(Gs1, H, W)

Gs2 = np.rot90(Gs1, k=1)
Gn2 = count_light(Gs2, W, H)

Gs3 = np.rot90(Gs2, k=1)
Gn3 = count_light(Gs3, H, W)

Gs4 = np.rot90(Gs3, k=1)
Gn4 = count_light(Gs4, W, H)

Gn2 = np.rot90(Gn2, k=-1)
Gn3 = np.rot90(Gn3, k=-2)
Gn4 = np.rot90(Gn4, k=-3)

Gsum = Gn1+Gn2+Gn3+Gn4
ans = int(np.max(Gsum)-3)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

Gs = np.asarray(S)
Gs_ = np.rot90(Gs, k=1)

def count_light(Gs):
    Gc = []
    for gs in Gs:
        count = 0
        gc = []
        for s in gs:
            if s == '#':
                count = 0
                gc.append(0)
            else:
                count += 1
                gc.append(count)
        Gc.extend([gc])

    Gc = np.asarray(Gc)

    Gn = []
    for gc in Gc:
        count = -1
        gn = []
        for c in reversed(gc):
            if c == 0:
                count = -1
                gn.append(0)
            else:
                if count == -1:
                    count = c
                gn.append(count)
        gn.reverse()
        Gn.extend([gn])

    Gn = np.asarray(Gn)
    return Gn

Gn = count_light(Gs)
Gn_ = count_light(Gs_)
Gn_ = np.rot90(Gn_, k=-1)

Gsum = Gn+Gn_
ans = np.max(Gsum)-1

        
print(ans)

Fixed submission:
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

def count_light(Gs, h, w):
    Gc = np.empty((h,w))
    for i in range(w):
        if i == 0:
            Gc[:, i] = Gs[:, i]
        else:
            Gc[:, i] = (Gc[:, i-1] + 1) * Gs[:, i]

    return Gc

Gs1 = np.asarray(S) == "."
Gn1 = count_light(Gs1, H, W)

Gs2 = np.rot90(Gs1, k=1)
Gn2 = count_light(Gs2, W, H)

Gs3 = np.rot90(Gs2, k=1)
Gn3 = count_light(Gs3, H, W)

Gs4 = np.rot90(Gs3, k=1)
Gn4 = count_light(Gs4, W, H)

Gn2 = np.rot90(Gn2, k=-1)
Gn3 = np.rot90(Gn3, k=-2)
Gn4 = np.rot90(Gn4, k=-3)

Gsum = Gn1+Gn2+Gn3+Gn4
ans = int(np.max(Gsum)-3)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
    
import numpy as np

Gs = np.asarray(S)
Gs_ = np.rot90(Gs, k=1)

def count_light(Gs):
    Gc = []
    for gs in Gs:
        count = 0
        gc = []
        for s in gs:
            if s == '#':
                count = 0
                gc.append(0)
            else:
                count += 1
                gc.append(count)
        Gc.append(gc)

    Gc = np.asarray(Gc)

    Gn = []
    for gc in Gc:
        count = -1
        gn = []
        for c in reversed(gc):
            if c == 0:
                count = -1
                gn.append(0)
            else:
                if count == -1:
                    count = c
                gn.append(count)
        gn.reverse()
        Gn.append(gn)

    Gn = np.asarray(Gn)
    return Gn

Gn = count_light(Gs)
Gn_ = count_light(Gs_)
Gn_ = np.rot90(Gn_, k=-1)

Gsum = Gn+Gn_
ans = np.max(Gsum)-1

        
print(ans)

Fixed submission:
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

def count_light(Gs, h, w):
    Gc = np.empty((h,w))
    for i in range(w):
        if i == 0:
            Gc[:, i] = Gs[:, i]
        else:
            Gc[:, i] = (Gc[:, i-1] + 1) * Gs[:, i]

    return Gc

Gs1 = np.asarray(S) == "."
Gn1 = count_light(Gs1, H, W)

Gs2 = np.rot90(Gs1, k=1)
Gn2 = count_light(Gs2, W, H)

Gs3 = np.rot90(Gs2, k=1)
Gn3 = count_light(Gs3, H, W)

Gs4 = np.rot90(Gs3, k=1)
Gn4 = count_light(Gs4, W, H)

Gn2 = np.rot90(Gn2, k=-1)
Gn3 = np.rot90(Gn3, k=-2)
Gn4 = np.rot90(Gn4, k=-3)

Gsum = Gn1+Gn2+Gn3+Gn4
ans = int(np.max(Gsum)-3)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

Gs = np.asarray(S)
Gs_ = np.rot90(Gs, k=1)

def count_light(Gs):
    Gc = []
    for gs in Gs:
        count = 0
        gc = []
        for s in gs:
            if s == '#':
                count = 0
                gc.append(0)
            else:
                count += 1
                gc.append(count)
        Gc.append(gc)

    Gc = np.asarray(Gc)

    Gn = []
    for gc in Gc:
        count = -1
        gn = []
        for c in gc[::-1]:
            if c == 0:
                count = -1
                gn.append(0)
            else:
                if count == -1:
                    count = c
                gn.append(count)
        Gn.append(gn[::-1])

    Gn = np.asarray(Gn)
    return Gn

Gn = count_light(Gs)
Gn_ = count_light(Gs_)
Gn_ = np.rot90(Gn_, k=-1)

Gsum = Gn+Gn_
ans = np.max(Gsum)-1

        
print(ans)

Fixed submission:
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

def count_light(Gs, h, w):
    Gc = np.empty((h,w))
    for i in range(w):
        if i == 0:
            Gc[:, i] = Gs[:, i]
        else:
            Gc[:, i] = (Gc[:, i-1] + 1) * Gs[:, i]

    return Gc

Gs1 = np.asarray(S) == "."
Gn1 = count_light(Gs1, H, W)

Gs2 = np.rot90(Gs1, k=1)
Gn2 = count_light(Gs2, W, H)

Gs3 = np.rot90(Gs2, k=1)
Gn3 = count_light(Gs3, H, W)

Gs4 = np.rot90(Gs3, k=1)
Gn4 = count_light(Gs4, W, H)

Gn2 = np.rot90(Gn2, k=-1)
Gn3 = np.rot90(Gn3, k=-2)
Gn4 = np.rot90(Gn4, k=-3)

Gsum = Gn1+Gn2+Gn3+Gn4
ans = int(np.max(Gsum)-3)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

Gs = np.asarray(S)
Gs_ = np.rot90(Gs, k=1)

def count_light(Gs):
    Gc = []
    for gs in Gs:
        count = 0
        gc = []
        for s in gs:
            if s == '#':
                count = 0
                gc.append(0)
            else:
                count += 1
                gc.append(count)
        Gc.append(gc)

    Gc = np.asarray(Gc)

    Gn = []
    for gc in Gc:
        count = -1
        gn = []
        for c in gc[::-1]:
            if c == 0:
                count = -1
                gn.append(0)
            else:
                if count == -1:
                    count = c
                gn.append(count)
        Gn.append(gn[::-1])

    Gn = np.asarray(Gn)
    return Gn

Gn = count_light(Gs)
Gn_ = count_light(Gs_)
Gn_ = np.rot90(Gn_, k=3)

Gsum = Gn+Gn_
ans = np.max(Gsum)-1

        
print(ans)

Fixed submission:
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

def count_light(Gs, h, w):
    Gc = np.empty((h,w))
    for i in range(w):
        if i == 0:
            Gc[:, i] = Gs[:, i]
        else:
            Gc[:, i] = (Gc[:, i-1] + 1) * Gs[:, i]

    return Gc

Gs1 = np.asarray(S) == "."
Gn1 = count_light(Gs1, H, W)

Gs2 = np.rot90(Gs1, k=1)
Gn2 = count_light(Gs2, W, H)

Gs3 = np.rot90(Gs2, k=1)
Gn3 = count_light(Gs3, H, W)

Gs4 = np.rot90(Gs3, k=1)
Gn4 = count_light(Gs4, W, H)

Gn2 = np.rot90(Gn2, k=-1)
Gn3 = np.rot90(Gn3, k=-2)
Gn4 = np.rot90(Gn4, k=-3)

Gsum = Gn1+Gn2+Gn3+Gn4
ans = int(np.max(Gsum)-3)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

Gs = np.asarray(S)
Gs_ = np.rot90(Gs, k=1)

def count_light(Gs):
    Gc = []
    for gs in Gs:
        count = 0
        gc = []
        for s in gs:
            if s == '#':
                count = 0
                gc.append(0)
            else:
                count += 1
                gc.append(count)
        Gc.append(gc)

    Gc = np.asarray(Gc)

    Gn = []
    for gc in Gc:
        count = -1
        gn = []
        for c in gc[::-1]:
            if c == 0:
                count = -1
                gn.append(0)
            else:
                if count == -1:
                    count = c
                gn.append(count)
        Gn.append(gn[::-1])

    Gn = np.asarray(Gn)
    return Gn

Gn = count_light(Gs)
Gn_ = count_light(Gs_)
Gn_ = np.rot90(Gn_, k=3)

ans = 0
for gn, gn_ in zip(Gn, Gn_):
    for n, n_ in zip(gn, gn_):
        ans = max(ans, n+n_-1)
        
print(ans)

Fixed submission:
H, W =  map(int, input().split())

S = []
for _ in range(H):
    tmp = list(input())
    S.append(tmp)
    
import numpy as np

def count_light(Gs, h, w):
    Gc = np.empty((h,w))
    for i in range(w):
        if i == 0:
            Gc[:, i] = Gs[:, i]
        else:
            Gc[:, i] = (Gc[:, i-1] + 1) * Gs[:, i]

    return Gc

Gs1 = np.asarray(S) == "."
Gn1 = count_light(Gs1, H, W)

Gs2 = np.rot90(Gs1, k=1)
Gn2 = count_light(Gs2, W, H)

Gs3 = np.rot90(Gs2, k=1)
Gn3 = count_light(Gs3, H, W)

Gs4 = np.rot90(Gs3, k=1)
Gn4 = count_light(Gs4, W, H)

Gn2 = np.rot90(Gn2, k=-1)
Gn3 = np.rot90(Gn3, k=-2)
Gn4 = np.rot90(Gn4, k=-3)

Gsum = Gn1+Gn2+Gn3+Gn4
ans = int(np.max(Gsum)-3)
print(ans)