Result

AC

Duration

899ms

Code [DL]

h,w=io.read("n","n")
for y=1,h do print("*"..string.rep((y>1 and y<h)and" "or"*",w-2).."*")end

stdin

45
99

stdout

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

stderr