#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
inline long long pw(long long a, long long n, long long res = 1) {
  while (n) {
    if (n & 1) res *= a;
    a *= a;
    n >>= 1;
  }
  return res;
}
inline long long read() {
  long long s = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = (s << 1) + (s << 3) + ch - '0';
    ch = getchar();
  }
  return s * f;
}
const long long N = 1e5 + 20;
const long long E = 1e6 + 20;
const long long inf = 1e18;
long long tt, n;
long long a[E];
vector<long long> v = {2};
vector<long long> k;
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> tt;
  while (tt--) {
    cin >> n;
    if (n <= 30) {
      cout << "NO\n";
      continue;
    } else {
      cout << "YES\n";
    }
    if (n == 36 || n == 40 || n == 44) {
      cout << "6 10 15 " << n - 31 << '\n';
    } else {
      cout << 6 << ' ' << 10 << ' ' << 14 << ' ' << n - 30 << '\n';
    }
  }
}
