#P11036. 【MX-X3-T3】「RiOI-4」GCD 与 LCM 问题

    ID: 10019 远端评测题 2000ms 512MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>数论Special JudgeO2优化Ad-hoc梦熊比赛

【MX-X3-T3】「RiOI-4」GCD 与 LCM 问题

Background

Original problem link: https://oier.team/problems/X3D.


"Since you said you do not understand her, why can you still assert that she must be because of ..."

Yes, I really do not know enough about Lingyu ... Lingluo thought.

In those incomplete memories, she could only recall that the greatest common divisor between her and Lingyu was "music".

What else was missing? Lingluo did not know. She only knew that what was missing, together with "music", was everything she had. The sum of everything.

Tick-tock, tick-tock. Ding-dong, ding-dong. If you piece together the broken piano sounds of different lengths, can you recall something?

Problem Description

Given a positive integer aa, construct three positive integers b,c,db, c, d such that a+b+c+d=gcd(a,b)+lcm(c,d)a+b+c+d=\gcd(a,b)+\operatorname{lcm}(c,d). There are multiple test cases in one test file.

Since the problem setter wants to put their QQ number into the statement, you need to ensure that b,c,d1634826193b, c, d\le 1\,634\,826\,193.

If there are multiple possible answers, output any one of them.

Input Format

The first line contains a positive integer tt, indicating the number of test cases.

The next tt lines each contain one positive integer aa.

Output Format

Output tt lines. Each line contains three positive integers b,c,db, c, d.

If there are multiple possible answers, output any one of them.

4
1
2
3
20120712
7 9 2
9 6 8
5 9 2
8065343 8750 6446

Hint

[Sample Explanation]

The constructions in the sample are:

1+7+9+2=19=gcd(1,7)+lcm(9,2)1+7+9+2=19=\gcd(1,7)+\operatorname{lcm}(9,2)
2+9+6+8=25=gcd(2,9)+lcm(6,8)2+9+6+8=25=\gcd(2,9)+\operatorname{lcm}(6,8)
3+5+9+2=19=gcd(3,5)+lcm(9,2)3+5+9+2=19=\gcd(3,5)+\operatorname{lcm}(9,2)
$20\,120\,712+8\,065\,343+8\,750+6\,446=28\,201\,251=\gcd(20\,120\,712,8\,065\,343)+\operatorname{lcm}(8\,750,6\,446)$

It is easy to verify that all of them satisfy the requirement.

[Constraints]

Test Point Score tt\le aa\le Special Property
11 22 1010
22 55 5050
33 1717 10610^6 5×1085\times10^8
44 2929 109110^9-1 aa is odd
55 4747 2×1062\times10^6 10910^9

For 100%100\% of the testdata, 1t2×1061\le t\le 2\times10^6, and 1a1091\le a\le 10^9.

Translated by ChatGPT 5