Result

WA

Duration

1990ms

Code [DL]

interface A{static void main(String[]a){var s=new java.util.Scanner(System.in);for(int p=s.nextInt(),q=s.nextInt()+1,i=1;i<p*q;)System.out.write(i++%q>0?i%q>2&&i/q%~-p>0?32:42:10);}}

stdin

36
87

stdout

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

stderr