Result

AC

Duration

987ms

Code [DL]

i=lambda:int(input())
y=i()
x=i()
c="*"
t=[c*x]
print("\n".join(t+[c+" "*(x-2)+c]*(y-2)+t))

stdin

30
79

stdout

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

stderr