-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path596-three-pairwise-maximums.cpp
More file actions
47 lines (44 loc) · 928 Bytes
/
Copy path596-three-pairwise-maximums.cpp
File metadata and controls
47 lines (44 loc) · 928 Bytes
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
/*
* Three Pairwise Maximums [1385A]
* Problem: https://codeforces.com/problemset/problem/1385/A
* Verdict: ACCEPTED Solved: 2020-08-04
* Language: C++17 (GCC 7-32)
* Runtime: 171 ms Memory: 3600 KB
* Tags: math
* Author: BidoTeima
* Source: https://codeforces.com/contest/1385/submission/88904366
*/
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
for(int i = 0; i < n; i++)
{
int x, y, z;
cin >> x >> y >> z;
if(x==y && y==z)
{
cout << "YES\n" << x << ' ' << y << ' ' << z << endl;
}
else
{
if (x == y && x > z)
{
cout << "YES\n" << x << ' ' << z << ' ' << 1 << endl;
}
else if (y == z && y > x)
{
cout << "YES\n" << y << ' ' << x << ' ' << 1 << endl;
}
else if (z == x && z > y)
{
cout << "YES\n" << z << ' ' << y << ' ' << 1 << endl;
}
else cout << "NO" << endl;
}
}
return 0;
}