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