QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 512 MB Puntuación total: 100 Hackeable ✓

#15548. 三个整数

Estadísticas

给你三个非负整数 $a$、$b$ 和 $c$。请找到三个正整数 $x$、$y$ 和 $z$,满足 $x \bmod y = a$,$y \bmod z = b$ 且 $z \bmod x = c$。

输入格式

第一行包含一个整数 $t$ ($1 \le t \le 10^5$) — 测试用例的数量。

每个测试用例在单行中包含 $3$ 个整数 $a, b, c$ ($0 \le a, b, c \le 10^9$)。

输出格式

对于每个测试用例,如果存在满足条件的三个整数,则输出 "YES",并在下一行输出这三个整数 $x, y, z$ ($1 \le x, y, z \le 10^{18}$),否则输出 "NO"。

样例

输入样例 1

4
0 0 0
1 2 3
6 6 6
11 3 3

输出样例 1

YES
1 1 1
YES
5 2 8
NO
YES
11 45 14

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.