#include <bits/stdc++.h>
using namespace std;
int n, t;
int main() {
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> n;
    if (n <= 30) {
      cout << "NO" << endl;
      continue;
    }
    if (n != 36 && n != 40 && n != 44)
      cout << "YES" << endl
           << 6 << " " << 10 << " " << 14 << " " << n - 30 << endl;
    else {
      cout << "YES" << endl;
      if (n == 36) cout << 5 << " " << 15 << " " << 10 << " " << 6 << endl;
      if (n == 40) cout << 15 << " " << 14 << " " << 6 << " " << 5 << endl;
      if (n == 44) cout << 15 << " " << 14 << " " << 6 << " " << 9 << endl;
    }
  }
  return 0;
}
