https://luyencode.net/problem/tamgiac

07/09/2023

help voi moi nguoi oi

Code
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define pq priority_queue
#define endl "\n"
#define FILENAME "DATA"

using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll mod = 1e9+7;
const ll oo = 1e18;
const int maxn = 1e5;

ull a,b,c;
double p, res;

bool check() {
	return (a+b > c and a+c>b and b+c>a);
}

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

	cin >> a >> b >> c;
	if (check()) {
		cout << (a+b+c) << " ";
		p = (a+b+c)/2;
		res = sqrt(p * (p-a) * (p-b) * (p-c));
		cout << fixed << setprecision(2) << res;
	}
	else cout << "NO";

	return 0;
}

// zuyn :33
// https://hieuhfgr.pythonanywhere.com/