#P12336. 第三心脏

第三心脏

Background

Third Heart.

Problem Description

mikage likes construction problems. One day, she came up with a simple construction problem:

Given aa, try to construct a quadruple of positive integers (a,b,c,d)(a,b,c,d) such that:

  1. a2+b2+c2+d2=abcd\sqrt{a^2+b^2+c^2+d^2}=a\oplus b\oplus c\oplus d.
  2. a<b<c<d<263a<b<c<d<2^{63}.

If there is no solution, output 1-1. Here, \oplus denotes bitwise XOR in binary.

Input Format

One line containing one integer aa.

Output Format

If there is a solution, output three integers b,c,db,c,d in one line separated by spaces. If there is no solution, output 1-1.

31
172 484 632

Hint

Sample Explanation

As stated in the problem.

Constraints

This problem uses bundled subtasks. You can get the score of a subtask only if you pass all testdata points in that subtask.

Subtask Range of aa Special Property Score
0 a10a\le 10 None 5
1 a300a\le 300
2 a4×103a\le 4\times 10^3 A 10
3 a107a\le 10^7 B
4 a2×108a\le 2\times 10^8 C 20
5 a109a\le 10^9 D 10
6 None 40

For all data, 1a1091\le a \le 10^9.

Special Property A: There exists an integer k2k\ge 2 such that a=2ka = 2^k.

Special Property B: a0(mod4)a \equiv 0 \pmod{4}.

Special Property C: a1(mod4)a \equiv 1 \pmod{4}.

Special Property D: There exists an integer k2k\ge 2 such that a=2k1a = 2^k-1.

Translated by ChatGPT 5