Created
January 2, 2017 13:49
-
-
Save Se7soz/aed46d729243ec37d7d5ca4384630e54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<cstdio> | |
#include<vector> | |
#include<algorithm> | |
#include<set> | |
#include<cstring> | |
#include<queue> | |
#include<map> | |
#include<stack> | |
#include<climits> | |
#include<cmath> | |
#include<sstream> | |
using namespace std; | |
int main(){ | |
int s, a, b, c; | |
cin >> s >> a >> b >> c; | |
if((a+b+c) == 0) { | |
printf("0 0 0\n"); | |
return 0; | |
} | |
double x = (double)s*a/(a+b+c); | |
double y = (double)s*b/(a+b+c); | |
double z = (double)s*c/(a+b+c); | |
printf("%.10lf %.10lf %.10lf\n", x, y, z); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment