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