#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    if (n < 31) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
    long long n1 = (n - 6 - 10 - 14);
    if (n1 == 6 || n1 == 10 || n1 == 14)
      cout << "6 10 15 " << n - 6 - 10 - 15 << '\n';
    else
      cout << "6 10 14 " << n - 6 - 10 - 14 << '\n';
  }
}
