#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
void result(int n) {
  if (n <= 30) {
    cout << "NO" << endl;
    return;
  }
  cout << "YES" << endl;
  if (n == 44) {
    cout << "6 7 10 21" << endl;
    return;
  }
  if (n == 40) {
    cout << "6 9 10 15" << endl;
    return;
  }
  if (n == 36) {
    cout << "5 6 10 15" << endl;
    return;
  }
  cout << "14 10 6 " << n - 30 << endl;
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    int n;
    cin >> n;
    result(n);
  }
  return 0;
}
