#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  cin >> test;
  while (test--) {
    int n;
    cin >> n;
    bool ok;
    if (n > 30) {
      cout << "YES" << endl;
      int a = n - (6 + 10 + 14);
      if (a == 6) {
        cout << "6 10 15 " << n - (6 + 10 + 15) << endl;
      } else if (a == 10) {
        cout << "6 14 15 " << n - (6 + 14 + 15) << endl;
      } else if (a == 14) {
        cout << "10 6 15 " << n - (10 + 6 + 15) << endl;
      } else
        cout << "6 10 14 " << n - (6 + 10 + 14) << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
