Result

AC

Duration

1627ms

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<1|y>h-2?"*":" ").repeat(w-2)+"*");}}

stdin

67
28

stdout

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

stderr