#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, i, j, k, l, t;
  cin >> t;
  while (t--) {
    cin >> n;
    l = n - 30;
    if (n < 31)
      cout << "NO" << endl;
    else if (n >= 31) {
      if (l == 6 || l == 14 || l == 10) {
        if (l == 6) {
          cout << "YES" << endl;
          cout << "14 15 6 1" << endl;
        } else if (l == 10) {
          cout << "YES" << endl;
          cout << "14 15 6 5" << endl;
        } else if (l == 14) {
          cout << "YES" << endl;
          cout << "21 15 6 2" << endl;
        }
      } else {
        if (l != 10 && l != 14 && l != 6) {
          cout << "YES" << endl;
          cout << "14 10 6"
               << " " << l << endl;
        } else
          cout << "NO" << endl;
      }
    }
  }
}
