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