Result

AC

Duration

1011ms

Code [DL]

i=input
h=int(i())
w=int(i())-2
for y in range(h):print(f"*{' *'[y in[0,h-1]]*w}*")

stdin

46
29

stdout

*****************************
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*                           *
*****************************

stderr