-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA.cpp
More file actions
57 lines (57 loc) · 1.32 KB
/
A.cpp
File metadata and controls
57 lines (57 loc) · 1.32 KB
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
#include <bits/stdc++.h>
#include <vector>
using namespace std;
#define ll long long
#define Speedo ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(x) x.begin(),x.end()
#define pb push_back
#define endl '\n'
#define return0 return 0
#define Endl endl
#define ull unsigned long long
#define elif else if
#define test cout<<" We Fucked up Here Boss_________________"<<endl
#define allout(first) for(auto ele : first) {cout<<ele<<" ";}cout<<endl;
void move1step(ll& a, ll& b, ll q) {
ll next = a - q * b;
a = b;
b = next;
}ll egcd(ll a, ll b, ll& x0, ll& y0) {
ll r0 = a, r1 = b;
ll x1, y1;
x1 = y0 = 0;
x0 = y1 = 1;
while (r1 != 0) {
ll q = r0 / r1;
move1step(x0, x1, q);
move1step(y0, y1, q);
move1step(r0, r1, q);
}
return r0;
}
void solve()
{
int n; cin >> n;
if (n <= 30) {
cout << "NO" << endl;
}
else {
cout << "YES" << endl;
if (n == 36 || n == 40 || n == 44) {
cout << 6 << ' ' << 10 << ' ' << 15 << ' ' << n - 31 << endl;
}
else {
cout << 6 << ' ' << 10 << ' ' << 14 << ' ' << n - 30 << endl;
}
}
}
int main()
{
Speedo;
int t = 1;
cin >> t;
while (t--)
{
solve();
}
}