#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n <= 30) {
      cout << "NO";
    } else if (n == 36) {
      cout << "YES\n";
      cout << "6 10 15 5";
    } else if (n == 40) {
      cout << "YES\n";
      cout << "6 10 15 9";
    } else if (n == 44) {
      cout << "YES\n";
      cout << "6 10 15 13";
    } else {
      cout << "YES\n";
      cout << "6 10 14 " << n - 30;
    }
    cout << "\n";
  }
}
