#include <bits/stdc++.h>
using namespace std;
double nthRoot(int A, int N) {
  double xPre = rand() % 10;
  double eps = 1e-3;
  double delX = INT_MAX;
  double xK;
  while (delX > eps) {
    xK = ((N - 1.0) * xPre + (double)A / pow(xPre, N - 1)) / (double)N;
    delX = abs(xK - xPre);
    xPre = xK;
  }
  return xK;
}
long long int MOD = 922337203685477580;
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y / 2;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a = 6, b = 10, c = 14, d = n - 30;
    if (n > 30) {
      cout << "YES" << endl;
      if (d == 6) {
        c = 15;
        d = 5;
      } else if (d == 10) {
        c = 15;
        d = 9;
      } else if (d == 14) {
        c = 15;
        d = 13;
      }
      cout << a << " " << b << " " << c << " " << d << endl;
    } else
      cout << "NO" << endl;
  }
}
