#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return power(x, y / 2) * power(x, y / 2);
  else
    return x * power(x, y / 2) * power(x, y / 2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n <= 30) {
      cout << "NO" << '\n';
    } else {
      if (n - 30 == 6 or n - 30 == 10 or n - 30 == 14) {
        cout << "YES" << '\n';
        cout << 6 << " " << 10 << " " << 15 << " " << n - 31 << '\n';
      } else {
        cout << "YES" << '\n';
        cout << 6 << " " << 10 << " " << 14 << " " << n - 30 << '\n';
      }
    }
  }
  return 0;
}
