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