Solution for DMOPC '19 Contest 7 P0 - Contest Feedback in C++


Aug. 4, 2020 0.071588 seconds C++
#include <bits/stdc++.h>
using namespace std;

typedef long long LL; 
typedef pair<int, int> pii; 
typedef pair<LL, LL> pll; 
typedef pair<string, string> pss; 
typedef vector<int> vi; 
typedef vector<vi> vvi; 
typedef vector<pii> vii; 
typedef vector<LL> vl; 
typedef vector<vl> vvl;
typedef queue<int> qi;
typedef queue<char> qc;
typedef stack<int> si;
typedef stack<char> sc;
#define F first
#define S second
#define PB push_back

double avg(double x, double y){
	cout << "\n";
	return ((x + y) / 2) * 1.000;
	
}

double avg(double x, double y, double z){
	cout << "\n";
	return ((x + y + z) / 3) * 1.000;
}

double avg(double x, double y, double z, double a){
	cout << "\n";
	return ((x + y + z + a) / 4) * 1.000;
}

int main()
{
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	
	cout << fixed << avg(a, b) << avg(a, c) << avg(a, d) << avg(b, c) << avg(b, d) << avg(c, d) << avg(a, b, c) << avg(a, b, d) << avg(a, c, d) << avg(b, c, d) << avg(a, b, c, d);
	return 0;
}

Editorial


No editorial for this problem. :(

Original Problem


You can view the original page for this problem on the DMOJ.