#include <bits/stdc++.h>
using namespace std;
int main() {
  int i = 0, j = 0, cs = 0, in;
  unsigned long long T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    int a = 6, b = 10, c = 14;
    if (n <= a + b + c)
      cout << "NO"
           << "\n";
    else {
      int x = n - (a + b + c);
      if (x == a || x == b || x == c) c = 15;
      cout << "YES"
           << "\n"
           << a << " " << b << " " << c << " " << n - (a + b + c) << "\n";
    }
  }
  return 0;
}
