Designer Door Mat
Mr. Vincent works in a door mat manufacturing company. One day, he designed a new door mat with the following specifications:
- Mat size must be X. ( is an odd natural number, and is times .)
- The design should have 'WELCOME' written in the center.
- The design pattern should only use
|,.and-characters.
Sample Designs
Size: 7 x 21
---------.|.---------
------.|..|..|.------
---.|..|..|..|..|.---
-------WELCOME-------
---.|..|..|..|..|.---
------.|..|..|.------
---------.|.---------
Size: 11 x 33
---------------.|.---------------
------------.|..|..|.------------
---------.|..|..|..|..|.---------
------.|..|..|..|..|..|..|.------
---.|..|..|..|..|..|..|..|..|.---
-------------WELCOME-------------
---.|..|..|..|..|..|..|..|..|.---
------.|..|..|..|..|..|..|.------
---------.|..|..|..|..|.---------
------------.|..|..|.------------
---------------.|.---------------
Input Format
A single line containing the space separated values of and .
Constraints
Output Format
Output the design pattern.
Sample Input
9 27
Sample Output
------------.|.------------
---------.|..|..|.---------
------.|..|..|..|..|.------
---.|..|..|..|..|..|..|.---
----------WELCOME----------
---.|..|..|..|..|..|..|.---
------.|..|..|..|..|.------
---------.|..|..|.--------- ------------.|.------------
# Enter your code here. Read input from STDIN. Print output to STDOUT
a,b=input().split()
a=int(a)
b=int(b)
c='.|.'
for i in range(a//2):
print(str(c*(2*i+1)).center(b,'-'))
print('WELCOME'.center(b,'-'))
'''
i -> 0,2
op-> 5,1
i,a->4,2,0
i=0
2*i+1=1,3,5
a=3
2a-(2i+1)
6-1
6-3
6-5
'''
for i in range(a//2):
print(str(c*(2*(a//2)-(2*i+1))).center(b,'-'))
Comments
Post a Comment