Result

AC

Duration

1022ms

Code [DL]

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

stdin

27
34

stdout

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

stderr