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