欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1684B.Z mod X = C
Z mod X = C
You are given three positive integers , , (). You have to find three positive integers , , such that:
$$x \bmod y = a,$$y \bmod z = b,$$z \bmod x = c.$$</p><p>Here$p \bmod q$denotes the remainder from dividing$p$by$q$. It is possible to show that for such constraints the answer always exists. ## Input The input consists of multiple test cases. The first line contains a single integer $t$ ($1 \le t \le 10\,000$) — the number of test cases. Description of the test cases follows. Each test case contains a single line with three integers $a$, $b$, $c$ ($1 \le a \lt b \lt c \le 10^8$). ## Output For each test case output three positive integers $x$, $y$, $z$ ($1 \le x, y, z \le 10^{18}$) such that $x \bmod y = a$, $y \bmod z = b$, $z \bmod x = c$. You can output any correct answer. ## Note In the first test case:$$$$## Samples ```input1 4 1 3 4 127 234 421 2 7 8 59 94 388 ``` ```output1 12 11 4 1063 234 1484 25 23 8 2221 94 2609 ```$$
在线编程 IDE
建议全屏模式获得最佳体验
键盘快捷键
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |
第 1 行,第 1 列
0 字符
-
最近自测结果
暂未运行
最近递交结果
暂无递交记录