#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n == 36) {
      cout << "YES" << endl;
      cout << 6 << " " << 5 << " " << 10 << " " << (n - (6 + 10 + 5)) << endl;
    } else if (n == 40) {
      cout << "YES" << endl;
      cout << 21 << " " << 10 << " " << 6 << " " << (n - (6 + 10 + 21)) << endl;
    } else if (n == 44) {
      cout << "YES" << endl;
      cout << 6 << " " << 7 << " " << 10 << " " << (n - (6 + 10 + 7)) << endl;
    } else if (n > (6 + 10 + 14) && ((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 {
      cout << "NO" << endl;
    }
  }
}
