#P5361. Dual Party Invitation Plan
Dual Party Invitation Plan
Dual Party Invitation Plan
Xiao Q has n friends. Every two friends either know each other or not. Xiao Q wants to organize two parties: a lively party on Saturday and an awkward party on Sunday.
The lively party has a liveliness parameter \(p\) and can invite an arbitrary number of friends, subject to the following conditions:
- For every invited friend, there must be at least \(p\) other attendees whom he/she knows.
- There is at least one invited friend for whom the number of other attendees he/she knows is exactly \(p\).
The awkward party has an awkwardness parameter \(q\) and exactly \(q\) friends are invited; moreover, any two of them do not know each other.
Note that the same friend might attend both parties and some may attend none. It is known that the parameters \(p\) and \(q\) satisfy \[ \left\lfloor\frac{n}{p+1}\right\rfloor \le q \quad \text{and} \quad \left\lfloor\frac{n}{q+1}\right\rfloor \le p. \]
Your task is to output a feasible invitation plan. In this problem, you may assume the acquaintance relationship is complete (i.e. every pair of friends know each other). Then a valid plan is as follows:
- For the lively party, set \(p=n-1\) and invite all \(n\) friends. Since every friend knows the other \(n-1\) friends, for every friend the number of acquaintances present is \(n-1\) (meeting the condition with equality for every friend).
- For the awkward party, set \(q=1\) and invite any single friend. A single friend trivially satisfies the pairwise non-acquaintance condition.
This plan satisfies the additional constraints since \[ \left\lfloor\frac{n}{n-1+1}\right\rfloor = \left\lfloor\frac{n}{n}\right\rfloor = 1 \le 1\quad \text{and} \quad \left\lfloor\frac{n}{1+1}\right\rfloor \le n-1 \text{ for } n \ge 2. \]
Input and Output formats:
inputFormat
The input consists of a single integer \(n\) (with \(n \ge 2\)), representing the number of friends.
outputFormat
The output consists of two lines:
- The first line contains the friend ids for the lively party (Saturday). They should be printed in increasing order separated by spaces. (We assume friend ids are integers from 1 to \(n\)).
- The second line contains the friend ids for the awkward party (Sunday). For our plan, output exactly one friend id.
sample
2
1 2
1
</p>