#include <bits/stdc++.h>
using namespace std;
long long mod(long long x) {
  return ((x % 1000000007 + 1000000007) % 1000000007);
}
long long add(long long a, long long b) { return mod(mod(a) + mod(b)); }
long long mul(long long a, long long b) { return mod(mod(a) * mod(b)); }
void solve() {
  long long n;
  cin >> n;
  if (n == 36) {
    cout << "YES\n";
    cout << "15 10 6 5\n";
    return;
  }
  if (n == 40) {
    cout << "YES\n";
    cout << "15 10 6 9\n";
    return;
  }
  if (n == 44) {
    cout << "YES\n";
    cout << "15 10 6 13\n";
    return;
  }
  if (n <= 30)
    cout << "NO\n";
  else {
    cout << "YES\n";
    cout << "6 10 14 " << n - 30 << "\n";
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
