#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  fast();
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    if (n < 31) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
      if (n == 36 || n == 40 || n == 44) {
        cout << 6 << " " << 10 << " " << 15 << " " << n - 31 << endl;
      } else {
        cout << 6 << " " << 10 << " " << 14 << " " << n - 30 << endl;
      }
    }
  }
  return 0;
}
