Mirror star pattern problem

problem link : https://hack.codingblocks.com/contests/c/509/168
I know i need to divide it into two subproblems i.e upper and lower half but i am not able to think of the loop conditions and logic. please help.

The pattern is pretty simple.
If you ind it difficult then first try making some simple patterns like upper and lower triangle.
It is a combination of both upper and lower triangles, where n for each would be half total number number of rows.