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