#include <bits/stdc++.h>
using namespace std;
string ans_t = "YES";
string ans_f = "NO";
void judge(int n) {
  if (n < 6 + 10 + 14 + 1) {
    cout << ans_f << endl;
  } else {
    cout << ans_t << endl;
    int tmp = n - 6 - 10 - 14;
    if (tmp == 6 || tmp == 10 || tmp == 14) {
      cout << "6 10 " << 14 + 1 << " " << tmp - 1 << endl;
    } else {
      cout << "6 10 14 " << tmp << endl;
    }
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    judge(n);
  }
  return 0;
}
