#K61072. Taco Sequence Generation

    ID: 31228 Type: Default 1000ms 256MiB

Taco Sequence Generation

Taco Sequence Generation

Given three integers \(n\), \(a\), and \(b\), generate a sequence of \(n\) numbers using the recurrence relation:

\(x_1 = a, \; x_2 = b, \; \text{and} \; x_i = x_{i-1} + x_{i-2} \; \text{for} \; i \ge 3\).

You will be given multiple test cases. Each test case consists of a line containing three integers \(n\), \(a\), and \(b\). The input terminates with a line "0 0 0" (which should not be processed). For each test case, output the generated sequence on one line, with the numbers separated by a single space.

inputFormat

The input is read from stdin and consists of multiple test cases. Each test case is given on a separate line containing three space-separated integers:

  • n: the length of the sequence
  • a: the first element of the sequence
  • b: the second element of the sequence

The input terminates with a line containing "0 0 0".

outputFormat

For each test case, output the generated sequence on a single line, with each number separated by a single space. The output should be written to stdout.

## sample
5 3 4
7 1 -1
10 0 0
0 0 0
3 4 7 11 18

1 -1 0 -1 -1 -2 -3 0 0 0 0 0 0 0 0 0 0

</p>