Result

AC

Duration

825ms

Code [DL]

<?php
$y=fgets(STDIN)+0;
$x=fgets(STDIN)+0;
echo str_repeat("*",$x)."\n";
for($i=0;$i<$y-2;$i++){echo ("*".str_repeat(" ",$x-2)."*\n");}
echo str_repeat("*",$x);
?>

stdin

57
24

stdout

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

stderr

PHP Notice:  A non well formed numeric value encountered in /volume/CODE on line 2
PHP Notice:  A non well formed numeric value encountered in /volume/CODE on line 3