Universal Cup Judging System

Universal Cup

حد الوقت: 4 s حد الذاكرة: 1024 MB مجموع النقاط: 100 الصعوبة: [عرض]
الإحصائيات

You know you are now in HSFZ, the famous math kingdom. So you have to solve some math problems. You are given two positive integers $p, q$. Your task is to construct positive integers $a, b, c, d$ such that $1 \le a, b, c, d \le 10^7$ and $$ \frac{a^3+b^3}{c^3+d^3} = \frac{p}{q} $$

输入格式

Each test contains multiple test cases. The first line contains one integer $t$ ($1 \le t \le 10^6$), indicating the number of test cases. For each test cases, only one line contains two integers $p, q$ ($1 \le p, q \le 10^4$).

输出格式

For each test case, output one line contains four integers $a, b, c, d$ ($1 \le a, b, c, d \le 10^7$). It can be proved that a solution always exist under above constraints.

样例

输入 1

2
1 1
9 28

输出 1

1 1 1 1
1 2 1 3

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.