We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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="")
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Designer Door Mat
You are viewing a single comment's thread. Return to all 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