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