Result

WA

Duration

1976ms

Code [DL]

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

stdin

35
23

stdout

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

stderr

Exception in thread "main" java.lang.ArithmeticException: / by zero
	at A.main(A.java:1)