Result

AC

Duration

1642ms

Code [DL]

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

stdin

48
74

stdout

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

stderr