Ichihime and Triangle

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 aa, bb, cc, dd, such that a≤b≤c≤da≤b≤c≤d.

Your task is to find three integers xx, yy, zz, satisfying the following conditions:

a≤x≤ba≤x≤b.
b≤y≤cb≤y≤c.
c≤z≤dc≤z≤d.
There exists a triangle with a positive non-zero area and the lengths of its three sides are xx, yy, and zz.
Ichihime desires to get the cookie, but the problem seems too hard for her. Can you help her?

Input

The first line contains a single integer tt (1≤t≤10001≤t≤1000) — the number of test cases.

The next tt lines describe test cases. Each test case is given as four space-separated integers aa, bb, cc, dd (1≤a≤b≤c≤d≤1091≤a≤b≤c≤d≤109).

Output

For each test case, print three integers xx, yy, zz — 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.

Sample Input

4
1 3 5 7
1 5 5 7
100000 200000 300000 400000
1 1 977539810 977539810

Sample Output

3 4 5
5 5 5
182690 214748 300999
1 977539810 977539810

Note

One of the possible solutions to the first test case:

在这里插入图片描述

One of the possible solutions to the second test case:

在这里插入图片描述

题目大意:

存在一个正非零面积的三角形,它的三个边的长度是x,y和z。x,y,z满足a≤x≤ba≤x≤b b≤y≤cb≤y≤c c≤z≤dc≤z≤d,输出满足条件的x,y,z。

解题思路:

输出b c c即满足以上条件。

代码如下:
#include<iostream>
#include<algorithm>
#include<cstdio>

using namespace std;

int main(){
	int a,b,c,d,x,y,z,t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d %d %d %d",&a,&b,&c,&d);
		printf("%d %d %d\n",b,c,c);
	}
	return 0;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值