#K70772. Taco String Generator
Taco String Generator
Taco String Generator
Problem Statement:
Given a non-negative integer ( n ), generate a string of length ( n ) composed exclusively of characters from the set ( {a, b, c} ). The generated string must not contain any occurrence of three consecutive identical characters. For example, if ( n = 5 ), a valid output could be abcab
(as it does not contain any substring like aaa
, bbb
, or ccc
). If ( n = 0 ), output an empty string.
Note: To ensure predictable and verifiable outputs in a competitive programming environment, you are expected to use a deterministic approach (e.g. cycling through the characters) rather than a random one. The generated solution should read input from standard input (stdin) and write the result to standard output (stdout).
inputFormat
Input Format: A single integer ( n ) (where ( 0 \leq n \leq 10^5 )) on a single line, representing the desired length of the string.
outputFormat
Output Format: Output the generated string of length ( n ) to standard output. If ( n = 0 ), output an empty string.## sample
0