409600: GYM103643 C Painting Fences (Easy Version)

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Painting Fences (Easy Version)time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

This is the easy version of the problem. In this version, Takagi only has to follow one rule.

Nishikata and Takagi are standing in front of an infinitely long fence. Fenceposts are numbered from $$$1$$$ to $$$\infty$$$ and fencepost $$$i$$$ costs $$$i$$$ units of paint to paint. They both also have an infinite amount of paint. The game for today will consist of painting a bit of that fence.

To try and make it fair, Nishikata has planned a few rules.

Nishikata's rules are as follows:

1. When painting, the two of them will only ever paint a contiguous interval of fenceposts.

2. He will pick a fencepost $$$n$$$, and he gets to paint that fencepost no matter what.

3. To minimize teasing, he will pick a segment of fenceposts that are disjoint from the fenceposts Takagi picks. In other words, he and Takagi will not ever paint the same fencepost.

As Takagi plays the game, she won't tell Nishikata, but she will follow these rules:

1. She will make the game end in a draw by making sure she and Nishikata will paint the same amount.

Takagi already knows how the game will end up, but you do not. So given the integer $$$n$$$ that Nishikata picks in rule $$$2$$$, find any two intervals $$$[a, b]$$$ that Nishikata paints and $$$[c, d]$$$ that Takagi paints that does not break either of their rules.

Input

You will answer $$$T$$$ testcases $$$(1 \leq T \leq 10^4)$$$. Each testcase contains an integer $$$n$$$ $$$(1 \leq n \leq 10^9)$$$ corresponding to the fencepost Nishikata picks in rule $$$2$$$.

Output

Output four integers $$$a, b, c, d$$$ where $$$[a, b]$$$ denotes the fenceposts Nishikata paints and $$$[c, d]$$$ denotes the fenceposts Takagi paints. It can be proven an answer always exists and it satisfies $$$(1 \leq a, b, c, d < 2^{31})$$$.

These two intervals must be disjoint and sum of $$$[a ... b]$$$ should be equal to sum of $$$[c ... d]$$$. Also $$$(a \leq n \leq b)$$$ must hold.

If there are multiple solutions, output any.

ExampleInput
2
1
9
Output
1 3 6 6
9 9 4 5
Note

Note that $$$1, 2, 3, 3$$$ is also a valid output for the first sample while $$$1, 5, 4, 6$$$ is not.

$$$---------------------------------------------$$$

Problem idea: 3366

Problem preparation: 3366

Occurrences: Novice 4

加入题单

算法标签: