#K66962. Magic String Generator
Magic String Generator
Magic String Generator
You are given an integer n. Your task is to create a magic string of length n by repeating the cycle of characters abc
. Specifically, when n satisfies the condition $$1 \le n \le 100000$$, the magic string is obtained by repeating the sequence "abc" until the length reaches at least n and then taking the first n characters. If n does not meet the condition, print NO
.
If a valid magic string can be generated, output two lines. The first line must contain YES
and the second line the magic string. Otherwise, print only NO
on a single line.
inputFormat
The input is read from standard input and consists of a single integer n in one line.
outputFormat
If n is valid (i.e. $$1 \le n \le 100000$$), the output should be two lines: the first line with YES
and the second line with the generated magic string of length n. Otherwise, output NO
on a single line.
3
YES
abc
</p>