#K48762. Diamond Star Pattern
Diamond Star Pattern
Diamond Star Pattern
Given a positive integer \( n \), generate a diamond shaped star pattern where the widest row contains \(2n - 1\) stars. The diamond has a half-height of \( n \) rows on the top and \( n-1 \) rows on the bottom. The pattern is symmetric horizontally and vertically.
If the input integer \( n \) is not between 1 and 100 (inclusive), output an error message.
For example, when \( n = 3 \), the output should be:
* *** ***** *** *
inputFormat
The input is provided via standard input (stdin) and consists of a single integer ( n ) (1 ≤ ( n ) ≤ 100).
outputFormat
Print the diamond star pattern to standard output (stdout) as described. If the input is invalid, print the error message: "Input must be a positive integer between 1 and 100."## sample
1
*