#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    if (n <= 30) {
      cout << "NO\n";
      continue;
    } else if (n - 30 == 6 || n - 30 == 10 || n - 30 == 14)
      cout << "YES\n6 10 15 " << n - 31 << "\n";
    else
      cout << "YES\n6 10 14 " << n - 30 << "\n";
  }
}
