A13436 | Ichihime and Triangle
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Ichihime is the current priestess of the Mahjong Soul Temple. She claims to be human, despite her cat ears.
These days the temple is holding a math contest. Usually, Ichihime lacks interest in these things, but this time the prize for the winner is her favorite — cookies. Ichihime decides to attend the contest. Now she is solving the following problem.
You are given four positive integers $a$ , $b$ , $c$ , $d$ , such that $a \leq b \leq c \leq d$ .
Your task is to find three integers $x$ , $y$ , $z$ , satisfying the following conditions:
- $a \leq x \leq b$ .
- $b \leq y \leq c$ .
- $c \leq z \leq d$ .
- There exists a triangle with a positive non-zero area and the lengths of its three sides are $x$ , $y$ , and $z$ .
Ichihime desires to get the cookie, but the problem seems too hard for her. Can you help her?
These days the temple is holding a math contest. Usually, Ichihime lacks interest in these things, but this time the prize for the winner is her favorite — cookies. Ichihime decides to attend the contest. Now she is solving the following problem.
You are given four positive integers $a$ , $b$ , $c$ , $d$ , such that $a \leq b \leq c \leq d$ .
Your task is to find three integers $x$ , $y$ , $z$ , satisfying the following conditions:
- $a \leq x \leq b$ .
- $b \leq y \leq c$ .
- $c \leq z \leq d$ .
- There exists a triangle with a positive non-zero area and the lengths of its three sides are $x$ , $y$ , and $z$ .
Ichihime desires to get the cookie, but the problem seems too hard for her. Can you help her?
输入格式
The first line contains a single integer $t$ ( $1 \leq t \leq 1000$ ) — the number of test cases.
The next $t$ lines describe test cases. Each test case is given as four space-separated integers $a$ , $b$ , $c$ , $d$ ( $1 \leq a \leq b \leq c \leq d \leq 10^9$ ).
The next $t$ lines describe test cases. Each test case is given as four space-separated integers $a$ , $b$ , $c$ , $d$ ( $1 \leq a \leq b \leq c \leq d \leq 10^9$ ).
输出格式
For each test case, print three integers $x$ , $y$ , $z$ — the integers you found satisfying the conditions given in the statement.
It is guaranteed that the answer always exists. If there are multiple answers, print any.
It is guaranteed that the answer always exists. If there are multiple answers, print any.
输入输出样例
输入 #1
4 1 3 5 7 1 5 5 7 100000 200000 300000 400000 1 1 977539810 977539810
输出 #1
3 4 5 5 5 5 182690 214748 300999 1 977539810 977539810
One of the possible solutions to the first test case:

One of the possible solutions to the second test case:


One of the possible solutions to the second test case:

C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted