Buggy python submission (verdict: Runtime Error):
import numpy as np
H,W,A,B = map(int, input().split())

mat = np.zeros((H,W))

for y in range(B):
    for x in range(A,W-A):
        mat[y][x]=1

for y in range(B,H-B+1):
    for x in range(A):
        mat[y][x]=1

for row in mat:
    row=list(map(int, row))
    print("".join(list(map(str, row))))

Fixed submission:
import numpy as np
H,W,A,B = map(int, input().split())

mat = np.zeros((H,W))

for y in range(B):
    for x in range(A,W):
        mat[y][x]=1

for y in range(B,H):
    for x in range(A):
        mat[y][x]=1

for row in mat:
    row=list(map(int, row))
    print("".join(list(map(str, row))))

Buggy python submission (verdict: Runtime Error):
flg=True

if H==1 and W!=1:
    if B!=0:
        flg=False
    else:
        for i in range(A):
            mat[0][i]=1

    
elif H!=1 and W==1: 
    if A!=0:
        flg=False
    else:
        for i in range(B):
            mat[i][0]=1
else:
    for y in range(H):
        xs=0
        for x in range(W):

            if y_weight[x] < A and xs < B:
                mat[y][x] = 1
                y_weight[x]+=1
                xs += 1
        if xs!=B:
            flg=False
        
            
    for i in y_weight:
        if i!=A:
            flg=False
    
if flg:
    for row in mat:
        row=list(map(int, row))
        print("".join(list(map(str, row))))
else:
    print("No")

Fixed submission:
import numpy as np
H,W,A,B = map(int, input().split())

mat = np.zeros((H,W))

for y in range(B):
    for x in range(A,W):
        mat[y][x]=1

for y in range(B,H):
    for x in range(A):
        mat[y][x]=1

for row in mat:
    row=list(map(int, row))
    print("".join(list(map(str, row))))

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

mat = [[0 for i in range(W)] for j in range(H)]

if H==1 and W!=1:
    for i in range(A):
        mat[0][i]=1
    
    
elif H!=1 and W==1: 
    for i in range(B):
        mat[i][0]=1
else:
    for y in range(H):
        for x in range(W):

            if sum(mat[:,x]) < A and sum(mat[y]) < B:
                mat[y][x] = 1
                    
for row in mat:
    row=list(map(int, row))
    print("".join(list(map(str, row))))

Fixed submission:
import numpy as np
H,W,A,B = map(int, input().split())

mat = np.zeros((H,W))

for y in range(B):
    for x in range(A,W):
        mat[y][x]=1

for y in range(B,H):
    for x in range(A):
        mat[y][x]=1

for row in mat:
    row=list(map(int, row))
    print("".join(list(map(str, row))))

Buggy python submission (verdict: Runtime Error):
import numpy as np
H,W,A,B = map(int, input().split())

mat = np.zeros((H,W))

if H==1 and W!=1:
    for i in range(A):
        mat[0][i]=1
    
elif H!=1 and W!=1: 
    for i in range(B):
        mat[i][0]=1
else:
    for y in range(H):
        for x in range(W):

            if sum(mat[:,x]) < A:
                mat[y][x] = 1

            if sum(mat[y]) == B:
                break


Fixed submission:
import numpy as np
H,W,A,B = map(int, input().split())

mat = np.zeros((H,W))

for y in range(B):
    for x in range(A,W):
        mat[y][x]=1

for y in range(B,H):
    for x in range(A):
        mat[y][x]=1

for row in mat:
    row=list(map(int, row))
    print("".join(list(map(str, row))))