其他分享
首页 > 其他分享> > 题解 CF1388A 【Captain Flint and Crew Recruitment】(思维、贪心)

题解 CF1388A 【Captain Flint and Crew Recruitment】(思维、贪心)

作者:互联网

AC代码:

#include<bits/stdc++.h>
using namespace std;

void solve() {
	int n; cin >> n;
	if (n <= 30)
		cout << "no" << endl;
	else {
		if (n != 36 && n != 40 && n != 44)
			cout << "YES\n6 10 14 " << n - 30 << "\n";
		else cout << "YES\n6 10 15 " << n - 31 << "\n";
	}
}

int main() {
	//freopen("in.txt", "r", stdin);
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	int t; cin >> t;
	while (t--)solve();
}

标签:std,AC,题解,cin,Crew,solve,Captain
来源: https://www.cnblogs.com/RioTian/p/13562007.html