Three Pairwise Maximums

You are given three positive (i.e. strictly greater than zero) integers x , y x, y x,y and z z z.

Your task is to find positive integers a , b a, b a,b and c c c such that x = m a x ( a , b ) x=max(a,b) x=max(a,b), y = m a x ( a , c ) y=max(a,c) y=max(a,c) and z = m a x ( b , c ) z=max(b,c) z=max(b,c), or determine that it is impossible to find such a , b a, b a,b and c c c.

You have to answer t independent test cases. Print required a , b a, b a,b and c c c in any (arbitrary) order.

Input

The first line of the input contains one integer t ( 1 ≤ t ≤ 2 ⋅ 1 0 4 ) t (1≤t≤2⋅10^4) t(1t2104) — the number of test cases. Then t t t test cases follow.

The only line of the test case contains three integers x , y x, y x,y, and z ( 1 ≤ x , y , z ≤ 1 0 9 ) z (1≤x,y,z≤10^9) z(1x,y,z109).

Output

For each test case, print the answer:

"NO" in the only line of the output if a solution doesn’t exist;
or "YES" in the first line and any valid triple of positive integers a , b a, b a,b and c ( 1 ≤ a , b , c ≤ 1 0 9 ) c (1≤a,b,c≤10^9) c(1a,b,c109) in the second line. You can print a , b a, b a,b and c c c in any order.

Example

input

5
3 2 3
100 100 100
50 49 49
10 30 20
1 1000000000 1000000000

output

YES
3 2 1
YES
100 100 100
NO
NO
YES
1 1 1000000000

#include <bits/stdc++.h>
using namespace std;
int a[10];
int main() {
    
    
    int _;
    scanf("%d", &_);
    while (_--) {
    
    
        for (int i = 0; i < 3; i++) {
    
    
            scanf("%d", &a[i]);
        }
        sort(a, a + 3);
        if (a[1] == a[2] && a[0] <= a[1]) {
    
    
            puts("YES");
            printf("%d %d 1\n", a[2], a[0]);
        } else {
    
    
            puts("NO");
        }
    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_43601103/article/details/112483217