#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  if (n < 31)
    cout << "NO"
         << "\n";
  else if (n == 36)
    cout << "YES"
         << "\n"
         << 5 << " " << 6 << " " << 10 << " " << 15 << "\n";
  else if (n == 40)
    cout << "YES"
         << "\n"
         << 5 << " " << 6 << " " << 14 << " " << 15 << "\n";
  else if (n == 44)
    cout << "YES"
         << "\n"
         << 6 << " " << 10 << " " << 13 << " " << 15 << "\n";
  else
    cout << "YES"
         << "\n"
         << 6 << " " << 10 << " " << 14 << " " << n - 30 << "\n";
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
