-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProblem-A.cpp
47 lines (38 loc) · 993 Bytes
/
Problem-A.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
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
// #define DEBUG
#define value(x) std::cerr << "Value of \"" << #x << "\" is " << x << '\n';
#define unto(i, begin, end) for (int i = begin; i < end; ++i)
#define print_array(array, begin, end) unto(i, begin, end) std::cout << array[i] << " \n"[i == end - 1];
int32_t main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);
std::cout.tie(NULL);
#ifdef DEBUG
printf("DEBUG was defined at compile time\n");
#endif // DEBUG
int tests_number;
std::cin >> tests_number;
while (tests_number--)
{
int x0, y0, z0;
std::cin >> x0 >> y0 >> z0;
int x = std::max(std::max(x0, y0), z0);
int z = std::min(std::min(x0, y0), z0);
int y = x0 + y0 + z0 - x - z;
if (x == y && y == z)
{
std::cout << "YES\n" << x << ' ' << y << ' ' << z << '\n';
}
else if (x == y && y > z)
{
std::cout << "YES\n" << x << ' ' << z << ' ' << 1 << '\n';
}
else
{
std::cout << "NO\n";
}
}
return 0;
}