Designer Door Mat

  • + 0 comments

    import math

    N, M = map(int, input().split()) if (5 <= N <= 101 )and(N % 2 == 1): M = int(N*3) center_N = math.ceil(N/2) center_M = math.ceil(M/2) dash_num = center_M - 2

    for i in range(0,N):
        if i < center_N-1:
            print("-"*dash_num,".|."*(2*i+1),"-"*dash_num,sep="")
            dash_num-=3
    
        if i == center_N-1:
            print("-"*(int((M-7)/2)),"WELCOME","-"*(int((M-7)/2)),sep="")
    
        if i > center_N-1:
            dash_num+=3
            j = N - i -1
            print("-"*dash_num,".|."*(2*j + 1),"-"*dash_num,sep="")