Result

AC

Duration

935ms

Code [DL]

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

stdin

18
68

stdout

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

stderr