#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 {
      cout << "YES" << endl;
      int val = n - 30;
      if (val == 14 || val == 10 || val == 6)
        cout << 15 << " " << 10 << " " << 6 << " " << val - 1 << endl;
      else
        cout << 14 << " " << 10 << " " << 6 << " " << n - 30 << endl;
    }
  }
  return 0;
}
