#include <bits/stdc++.h>
using namespace std;
const int inf = 100000005;
const int N = 1000001;
const long double pi = 3.1415926535897;
void solve() {
  int n;
  cin >> n;
  if (n <= 30)
    cout << "NO";
  else if (n != 36 and n != 40 and n != 44)
    cout << "YES\n6 10 14 " << n - 30;
  else
    cout << "YES\n6 10 15 " << n - 31;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
