#C5604. Modulo Sequence Generation
Modulo Sequence Generation
Modulo Sequence Generation
You are given a single integer \( N \) (where \( 0 \le N \le 10^6 \)). Your task is to generate a sequence \( S \) of length \( N \) where each element \( S[i] \) is defined as:
\( S[i] = i \mod 3 \)
for every \( 0 \le i < N \). For example, if \( N = 5 \), the sequence is \( [0, 1, 2, 0, 1] \).
Print the sequence on a single line with the numbers separated by a space.
inputFormat
The input is a single integer ( N ) provided via standard input.
outputFormat
Output the sequence ( S ) consisting of ( N ) integers calculated as ( S[i] = i \mod 3 ). The numbers should be printed in one line separated by a single space.## sample
5
0 1 2 0 1