#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, c;
  cin >> t;
  while (t--) {
    cin >> n;
    if (n > 30) {
      if (!(n - 30 == 6 || n - 30 == 10 || n - 30 == 14))
        cout << "YES\n" << 6 << " " << 10 << " " << 14 << " " << n - 30 << endl;
      else
        cout << "YES\n" << 6 << " " << 10 << " " << 15 << " " << n - 31 << endl;
    } else
      cout << "NO\n";
  }
  return 0;
}
