#include <bits/stdc++.h>
using namespace std;
const long long int LL_MAX = 1e18 + 5;
const int MX = INT_MAX;
const long long int mod = 1000000007;
const int maxx = 2e5;
const int d4i[4] = {-1, 0, 1, 0};
const int d4j[4] = {0, 1, 0, -1};
const int d8i[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
const int d8j[8] = {0, 1, 1, 1, 0, -1, -1, -1};
bool rev(int a, int b) { return a >= b; }
string y = "YES", no = "NO";
void solve() {
  int n;
  cin >> n;
  ;
  int a[] = {6, 10, 14, 15, 21};
  if (n < 31) {
    cout << no << "\n";
  } else {
    cout << y << "\n";
    set<int> ans;
    for (int i = (0); i < (3); i++) {
      ans.insert(a[i]);
    }
    ans.insert(n - 30);
    if ((int)ans.size() == 4) {
      for (int i = (0); i < (3); i++) {
        cout << a[i] << " ";
      }
      cout << n - 30 << "\n";
      return;
    }
    set<int> anss;
    for (int i = (0); i < (2); i++) {
      anss.insert(a[i]);
    }
    anss.insert(15);
    anss.insert(n - 31);
    if ((int)anss.size() == 4) {
      for (int i = (0); i < (2); i++) {
        cout << a[i] << " ";
      }
      cout << "15 ";
      cout << n - 31 << "\n";
      return;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  for (int i = (1); i < (t + 1); i++) {
    solve();
  };
  return 0;
}
