def get_grid_shape(m):
 r = int(np.sqrt(m))
 c = (m // r)
 while ((r * c) < m):
  c += 1
 return (r, c)

def get_grid_shape ( m ) : r = int ( np . sqrt ( m ) ) c = ( m // r ) while ( ( r * c ) < m ) : c += 1 return ( r , c )
adjust the shape of the grid to show .