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