#P10585. 「ALFR Round 2」A Sum

「ALFR Round 2」A Sum

Problem Description

Given three integers n,p,qn, p, q, you need to construct a sequence aa of length nn such that:

  • $\forall 1 \leq i \leq n: 1 \leq a_i \leq 10^7, a_i \in \mathbb{Z}$;

  • $(\sum\limits_{1 \leq i < j \leq n} [a_i + a_j \leq q]) = p$。

In plain words, each number is a positive integer within [1,107][1, 10^7], and among the n(n1)2\dfrac{n(n-1)}{2} pair sums formed by choosing two numbers from different positions (order does not matter), there are exactly pp sums that are not greater than qq. You only need to output one valid construction.

Input Format

One line with three integers n,p,qn, p, q.

Output Format

One line with nn numbers, representing the constructed sequence.

4 2 5
1 3 4 15

Hint

Constraints

Subtask Score Restriction
00 2020 p=0p=0
11 8080 -

For 100%100\% of the testdata, 4n1064 \leq n \leq 10^6, 0pn(n1)20 \leq p \leq \dfrac{n(n-1)}{2}, 4q1074 \leq q \leq 10^7.

Update 2024.7.1: According to this post, a set of hack testdata was added into subtask 22, with a score of 00 points.

Translated by ChatGPT 5