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