#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  auto sgn = [&](int x) {
    if (x > 0)
      return 1;
    else
      return -1;
  };
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n <= 30)
      cout << "NO" << '\n';
    else {
      if ((((n - 30) == 6) || ((n - 30) == 10) || ((n - 30) == 14))) {
        cout << "YES" << '\n';
        cout << 6 << " " << 10 << " " << 15 << " " << (n - 31) << '\n';
      } else {
        cout << "YES" << '\n';
        cout << 6 << " " << 10 << " " << 14 << " " << (n - 30) << '\n';
      }
    }
  }
}
