Result

AC

Duration

1092ms

Code [DL]

process.stdin.on('data',s=>{[h,w]=(''+s).split(`
`),r='repeat',a='*'[r](w)+`
`,console.log(a+`*${' '[r](w-2)}*
`[r](h-2)+a)})

stdin

54
31

stdout

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

stderr