A. Ichihime and Triangle

滴答滴答---题目链接 

A. Ichihime and Triangle

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

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.

Example

input

Copy

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

output

Copy

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:

#include <bits/stdc++.h>
using namespace std;
const int maxn=100001;
typedef  long long  ll;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        cout<<b<<" "<<c<<" "<<c<<endl;
    }
    return 0;
}
发布了1317 篇原创文章 · 获赞 329 · 访问量 24万+

猜你喜欢

转载自blog.csdn.net/chen_zan_yu_/article/details/105553518