#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, t;
  cin >> t;
  while (t--) {
    cin >> a;
    if (a < 31) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
      b = a - 10 - 6 - 14;
      if (a == 36) {
        cout << 5 << " " << 6 << " " << 10 << " " << 15 << endl;
      } else if (a == 40) {
        cout << 3 << " " << 6 << " " << 10 << " " << 21 << endl;
      } else if (a == 44) {
        cout << 7 << " " << 6 << " " << 10 << " " << 21 << endl;
      } else {
        cout << b << " " << 6 << " " << 10 << " " << 14 << endl;
      }
    }
  }
}
