Result

AC

Duration

2091ms

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

39
32

stdout

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

stderr