Result

AC

Duration

1578ms

Code [DL]

class A{public static void main(String[]a){var s=new java.util.Scanner(System.in);int h=s.nextInt(),w=s.nextInt(),y=h;for(;y-->0;)System.out.println("*"+(y==0||y==h-1?"*":" ").repeat(w-2)+"*");}}

stdin

57
52

stdout

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

stderr