#K7071. Taco Pattern Generator
Taco Pattern Generator
Taco Pattern Generator
You are given a non-negative integer N. Your task is to generate a pattern consisting of N segments. The pattern follows these rules:
- The first segment is the string
123456
. - The second segment (if it exists) is
654321
. - From then on, the segments alternate: even-indexed (0-based) segments are
123456
and odd-indexed segments are654321
.
For example:
- If N = 1, output:
123456
- If N = 2, output:
123456 654321
- If N = 3, output:
123456 654321 123456
- If N = 4, output:
123456 654321 123456 654321
- If N = 0, output an empty string.
Input and Output Format: Each test case consists of an input provided on stdin
and the corresponding answer should be printed to stdout
.
Note: There is only one integer in the input representing N.
inputFormat
The input is provided via stdin
and contains a single non-negative integer N on one line.
Example:
3
outputFormat
The output should be the generated pattern corresponding to the input N. For N segments, alternate between 123456
and 654321
(starting with 123456
for index 0). Each segment is separated by a single space. If N is 0, print nothing.
Example:
123456 654321 123456## sample
1
123456