Result

AC

Duration

907ms

Code [DL]

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

stdin

26
86

stdout

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

stderr