#include <bits/stdc++.h>
using namespace std;
string toString(long long n) {
  stringstream ss;
  ss << n;
  return ss.str();
}
void yesNo(bool ck) { cout << (ck ? "YES\n" : "NO\n"); }
vector<long long> removeDup(vector<long long> v) {
  sort(v.begin(), v.end());
  v.resize(distance(v.begin(), unique(v.begin(), v.end())));
  return v;
}
const int N = 2e5 + 50;
int main() {
  long long t = 1;
  cin >> t;
  for (long long T = 1; T <= t; T++) {
    long long n;
    cin >> n;
    if (n >= 31) {
      cout << "YES\n";
      map<long long, long long> mp;
      mp[6] = 1, mp[10] = 1, mp[14] = 1;
      if (mp[n - 30] == 1) {
        cout << "6 10 15 " << n - 31 << "\n";
      } else {
        cout << "6 10 14 " << n - 30 << "\n";
      }
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
