-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1385A - Three Pairwise Maximums.cpp
93 lines (81 loc) · 1.75 KB
/
1385A - Three Pairwise Maximums.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include <iostream>
#include <stdio.h>
#include <vector>
#include <cmath>
#include <iomanip>
#include <math.h>
#include <set>
#include <algorithm>
#include <utility>
using namespace std;
#define nn <<endl
#define ll long long int
#define flo for(auto i:
#define i0 for(int i=0; i<
#define i1 for(int i=1; i<
#define oi ;i++)
#define j0 for(int j=0; j<
#define j1 for(int j=1; j<
#define oj ;i++)
int main()
{
ll t;
cin >> t;
ll x1[t], y1[t], z1[t];
i0 t oi
cin >> x1[i] >> y1[i] >> z1[i];
ll x, y, z;
ll a, b, c;
for (int i = 0; i < t; i++)
{
x = x1[i];
y = y1[i];
z = z1[i];
if (x == y && x == z)
{
cout << "YES" nn;
cout << x << " " << y << " " << z nn;
}
else if (x == y)
{
a = x;
b = z;
c = z-1;
if(z == 1) c = b = 1;
if (z > x) cout << "NO" nn;
else
{
cout << "YES" nn;
cout << a << " " << b << " " << c nn;
}
}
else if (x == z)
{
a = x;
b = y;
c = y-1;
if(y == 1) c = b = 1;
if (y > x) cout << "NO" nn;
else
{
cout << "YES" nn;
cout << a << " " << b << " " << c nn;
}
}
else if (y == z)
{
a = y;
b = x;
c = x-1;
if(x == 1) c = b = 1;
if (x > y) cout << "NO" nn;
else
{
cout << "YES" nn;
cout << a << " " << b << " " << c nn;
}
}
else cout << "NO" nn;
}
return 0;
}