← All problems‹ PrevNext ›Star PyramidEasy#basics#loops#patterns· solved by 0 · time limit 2.0 sPrint a centred pyramid with nnn rows. Row kkk has n−kn-kn−k spaces followed by 2k−12k-12k−1 stars (no trailing spaces).InputA single integer nnn.Outputnnn lines.Constraints1≤n≤501 \le n \le 501≤n≤50Sample 1Input3 Output * *** *****