Result

AC

Duration

968ms

Code [DL]

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

stdin

44
26

stdout

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

stderr