#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long n, i, a;
    cin >> n;
    if (n >= 31) {
      cout << "YES" << endl;
      long s = n - 30;
      long s1 = n - 31;
      long s2 = n - 37;
      if (s != 6 && s != 10 && s != 14) {
        cout << 6 << " " << 10 << " " << 14 << " " << n - 30 << endl;
      } else if (s1 != 6 && s1 != 10 && s1 != 15) {
        cout << 6 << " " << 10 << " " << 15 << " " << n - 31 << endl;
      } else if (s2 != 6 && s2 != 10 && s2 != 21) {
        cout << 6 << " " << 10 << " " << 21 << " " << n - 37 << endl;
      }
    } else {
      cout << "NO" << endl;
    }
  }
}
