#include <bits/stdc++.h>
using namespace std;
long long inf = 1000000000000000000, mod = 1000000007, BS;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    if (n <= 30) {
      cout << "NO" << endl;
    } else {
      if (n == 36) {
        cout << "YES" << endl;
        cout << "5 6 10 15" << endl;
      } else if (n == 44) {
        cout << "YES" << endl;
        cout << "14 15 6 9" << endl;
      } else if (n == 40) {
        cout << "YES" << endl;
        cout << "15 14 10 1" << endl;
      } else {
        cout << "YES" << endl;
        cout << "6 10 14 " << n - 30 << endl;
      }
    }
  }
}
