#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  if (n <= 30)
    cout << "NO\n";
  else {
    cout << "YES\n";
    long long d = n - 30;
    long long a = 6, b = 10, c = 14;
    if (d == 6 || d == 10 || d == 14)
      cout << "6 10 15 " << d - 1 << endl;
    else
      cout << "6 10 14 " << d << endl;
  }
}
signed main() {
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
