#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n <= 30)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      int a = 6, b = 10, c = 14, d = 15;
      int v = n - a - b - c;
      if (v == a) {
        cout << 5 << " " << 6 << " " << 10 << " " << 15 << endl;
      } else {
        if (v == b) {
          cout << a << " " << c << " " << d << " " << n - a - c - d << endl;
        } else if (v == c) {
          cout << a << " " << b << " " << d << " " << n - a - b - d << endl;
        } else {
          cout << a << " " << b << " " << c << " " << n - a - b - c << endl;
        }
      }
    }
  }
}
