by@tyage
AC
1120ms
[a,b]=(0+require('fs').readFileSync(i=0)).split` ` for(;i<a;)console.log(`*${'* '[i++&&i<a&1].repeat(b-2)}*`)
23 83
*********************************************************************************** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ***********************************************************************************