Result

AC

Duration

1220ms

Code [DL]

my ($y,$x)=lines()».Int »-»2;
my $s="*"x($x+2)~"\n";
say $s~("*"~(" "x$x)~"*\n")x$y~$s

stdin

28
37

stdout

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

stderr