Result

AC

Duration

1132ms

Code [DL]

h,w=$<.map &:to_i;puts _=?**w,["*#{?\s*(w-2)}*"]*h-=2,_

stdin

12
77

stdout

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

stderr