#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed << setprecision(15);
  int T;
  cin >> T;
  while (T-- > 0) {
    int a = 6, b = 10, c = 14, d = 15;
    int n;
    cin >> n;
    int x = n - a - b - c;
    int y = n - a - b - d;
    if (n > a + b + c && x != a && x != b && x != c) {
      cout << "YES\n";
      cout << a << ' ' << b << ' ' << c << ' ' << x << '\n';
    } else if (n > a + b + d && y != a && y != b && y != d) {
      cout << "YES\n";
      cout << a << ' ' << b << ' ' << d << ' ' << y << '\n';
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
