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