[백준] 9076 점수 집계

0

백준

목록 보기
156/271
post-thumbnail

[백준] 9076 점수 집계

#include <vector>
#include <algorithm>
#include <math.h>
#include <iostream>
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);

	int t;
	cin >> t;
	while (t--) {
		vector<int> score;
		for (int i = 0; i < 5; ++i) {
			int input;
			cin >> input;
			score.push_back(input);
		}

		sort(score.begin(), score.end());

		if (abs(score[1] - score[3]) >= 4) cout << "KIN\n";
		else cout << score[1] + score[2] + score[3] << "\n";
	}

	return 0;
}

profile
Be able to be vulnerable, in search of truth

0개의 댓글