#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  if (n < 31) {
    cout << "NO\n";
    return;
  }
  if (n - 30 != 6 && n - 30 != 10 && n - 30 != 14) {
    cout << "YES\n6 10 14 ";
    cout << n - 30 << "\n";
  } else {
    cout << "YES\n6 10 15 ";
    cout << n - 31 << "\n";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
