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