#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
signed main() {
  long long int t;
  cin >> t;
  vector<long long int> nums = {6, 10, 14, 15};
  long long int minS = nums[0] + nums[1] + nums[2];
  long long int maxS = nums[0] + nums[1] + nums[3];
  while (t--) {
    long long int n;
    cin >> n;
    if (n <= minS)
      cout << "NO\n";
    else {
      long long int d = n - minS;
      if (d == nums[0] || d == nums[1] || d == nums[2]) {
        if (n <= maxS)
          cout << "NO\n";
        else
          cout << "YES\n"
               << 6 << " " << 10 << " " << 15 << " " << n - maxS << "\n";
      } else
        cout << "YES\n" << 6 << " " << 10 << " " << 14 << " " << d << "\n";
    }
  }
  return 0;
}
