#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, c, i, t, j, x = 0, y = 0, d = 0, p, q;
  cin >> t;
  while (t--) {
    cin >> n;
    a = 6;
    b = 10;
    c = 14;
    d = n - (a + b + c);
    if (d < 1) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
      if (n == 44) {
        cout << 6 << " " << 7 << " " << 10 << " " << 21 << endl;
      } else if (n == 36) {
        cout << 5 << " " << 6 << " " << 10 << " " << 15 << endl;
      } else if (n == 40) {
        cout << 5 << " " << 6 << " " << 14 << " " << 15 << endl;
      } else
        cout << a << " " << b << " " << c << " " << d << endl;
    }
  }
}
