#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, n, q, y, t, x, p;
  string s;
  cin >> t;
  while (t--) {
    cin >> n;
    if (n < 31)
      cout << "NO\n";
    else {
      cout << "YES\n";
      if (n == 36)
        cout << "6 10 15 5";
      else if (n == 40)
        cout << "6 10 15 9";
      else if (n == 44)
        cout << "6 10 15 13";
      else
        cout << "6 10 14 " << n - 30;
      cout << '\n';
    }
  }
}
