#include <bits/stdc++.h>
using namespace std;
const int long long inf = numeric_limits<int long long>::max();
struct __io {
  __io() {
    ios_base::Init i;
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  }
} __io;
signed main() {
  int long long t;
  cin >> t;
  while (t--) {
    int long long n;
    cin >> n;
    if (n == 36) {
      cout << "YES\n";
      cout << "5 6 10 15\n";
    } else if (n == 40) {
      cout << "YES\n";
      cout << "9 6 10 15\n";
    } else if (n == 44) {
      cout << "YES\n";
      cout << "6 7 10 21\n";
    } else if (n >= 31) {
      cout << "YES\n";
      cout << "6 10 14 " << n - 30 << '\n';
    } else {
      cout << "NO\n";
    }
  }
}
