Result

AC

Duration

1386ms

Code [DL]

using S=System.Console;class A{static int r=>int.Parse(S.ReadLine());static void Main(){for(int h=r,w=r,y=h;;)S.Write($"*{"*\n".PadLeft(w,h%y--<1?'*':' ')}");}}

stdin

17
42

stdout

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

stderr

Unhandled Exception:
System.DivideByZeroException: Attempted to divide by zero.
  at A.Main () [0x00013] in <9dff7e68975644fd82a62294597bfe4a>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.DivideByZeroException: Attempted to divide by zero.
  at A.Main () [0x00013] in <9dff7e68975644fd82a62294597bfe4a>:0