Designer Door Mat

  • + 0 comments
    n,m = map(int,input().split())
    top_bottom_loop = (n - 1) // 2
    # top layer
    dot_pattern = 1
    for i in range(top_bottom_loop):
        hyphen = (m - 3 * dot_pattern) // 2
        print('-' * hyphen + ".|." * dot_pattern + '-' * hyphen)
        dot_pattern += 2
    
    # mid layer
    hyphen_welcome = (m - 7) // 2
    print("-" * hyphen_welcome + "WELCOME" + "-" * hyphen_welcome)
    
    # bottom layer
    dot_pattern -= 2 
    for i in range(top_bottom_loop):
        hyphen = (m - 3 * dot_pattern) // 2
        print('-' * hyphen + ".|." * dot_pattern + '-' * hyphen)
        dot_pattern -= 2