Result

AC

Duration

1169ms

Code [DL]

$_=get;say $!="*"x($/=get),"
","*{" "x$/-2}*
"x$_-2,$!

stdin

21
32

stdout

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

stderr