#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(NULL);
  int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    int d = 6 + 10 + 14;
    if (n <= d)
      cout << "NO" << endl;
    else {
      int x = n - d;
      if (x == 6 || x == 10 || x == 14) {
        d++;
        if (n <= d)
          cout << "NO" << endl;
        else {
          cout << "YES" << endl;
          cout << 6 << " " << 10 << " " << 15 << " " << n - d << endl;
        }
      } else {
        cout << "YES" << endl;
        cout << 6 << " " << 10 << " " << 14 << " " << n - d << endl;
      }
    }
  }
  return 0;
}
