Result

AC

Duration

1668ms

Code [DL]

import std.stdio,std.conv,std.string;void main(){for(int h=readln.chomp.to!int,w=readln.chomp.to!int,i=++w*h;i--;){write((-~i%w>2)&(i>w)&(i<w*h-w)?' ':i%w?'*':'\n');}}

stdin

73
89

stdout

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

stderr