#K39772. Magical Sequence Generation

    ID: 26495 Type: Default 1000ms 256MiB

Magical Sequence Generation

Magical Sequence Generation

Given an integer \(n\), generate a sequence of \(n\) integers where each number from 1 to \(n\) is transformed based on its parity. For an odd integer \(i\), compute \(i^3\) (i.e., cube of \(i\)). For an even integer \(i\), compute \(i^2\) (i.e., square of \(i\)).

Example:

  • For \(n=5\): The sequence is \(1^3, 2^2, 3^3, 4^2, 5^3 = [1, 4, 27, 16, 125]\).
  • For \(n=3\): The sequence is \(1^3, 2^2, 3^3 = [1, 4, 27]\).

inputFormat

The input consists of a single integer \(n\) read from stdin, which represents the number of elements in the sequence.

outputFormat

Output the generated sequence to stdout as a single line of space-separated integers.

## sample
5
1 4 27 16 125