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 = list(map(int,input().split()))
wlen = len('WELCOME')
j = 0
for i in range(N):
# for j in range(M):
if i < (N-1)/2:
print('-'*int((M-(1+i*2)3)/2) + '.|.'(1+i*2) + '-'*int((M-(1+i*2)*3)/2))
elif i==(N-1)/2:
print('-'*int((M-7)/2) + 'WELCOME' + '-'int((M-7)/2))
else: # i>=(N+1)/2:
print('-'(3+j*3)+ '.|.'*(N-2-2*j)+'-'*(3+j*3))
j +=1
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 →
N, M = list(map(int,input().split())) wlen = len('WELCOME') j = 0 for i in range(N): # for j in range(M): if i < (N-1)/2: print('-'*int((M-(1+i*2)3)/2) + '.|.'(1+i*2) + '-'*int((M-(1+i*2)*3)/2)) elif i==(N-1)/2: print('-'*int((M-7)/2) + 'WELCOME' + '-'int((M-7)/2)) else: # i>=(N+1)/2: print('-'(3+j*3)+ '.|.'*(N-2-2*j)+'-'*(3+j*3)) j +=1