Universal Cup Judging System

Universal Cup

Límite de tiempo: 4 s Límite de memoria: 1024 MB Puntuación total: 100 Dificultad: [mostrar]
Estadísticas

Теперь вы находитесь в HSFZ, знаменитом королевстве математики. Поэтому вам предстоит решить несколько математических задач. Вам даны два целых положительных числа $p$ и $q$. Ваша задача — построить целые положительные числа $a, b, c, d$ такие, что $1 \le a, b, c, d \le 10^7$ и $$ \frac{a^3 + b^3}{c^3 + d^3} = \frac{p}{q} $$

Входные данные

Каждый тестовый пример содержит несколько тестов. Первая строка содержит целое число $t$ ($1 \le t \le 10^6$), указывающее количество тестов. Для каждого теста в отдельной строке даны два целых числа $p, q$ ($1 \le p, q \le 10^4$).

Выходные данные

Для каждого теста выведите строку, содержащую четыре целых числа $a, b, c, d$ ($1 \le a, b, c, d \le 10^7$). Можно показать, что при указанных ограничениях решение всегда существует.

Примеры

Входные данные 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.