by@utgwkk
AC
1140ms
[a,b]=(0+require('fs').readFileSync(i=0)).split(` `) for(;i<a;)console.log(`*${'* '[+(i++&&i<a)].repeat(b-2)}*`)
15 89
***************************************************************************************** * * * * * * * * * * * * * * * * * * * * * * * * * * *****************************************************************************************