Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
672 B
1
Indexable
Never
#include <bits/stdc++.h>
#define endl '\n'
#define maxn 15
#define TASK bai1
#define For(i,a,b) for ( int i = a; i <= b; i++ )
#define Ford(i,a,b) for ( int i = a; i >= b; i-- )
#define MOD 100000000000007

using namespace std;
int A,B,C,p,q,r;

void inp()
{
    cin >> A >> B >> C >> p >> q >> r;
}
void solve()
{
    double a = A,b = B,c = C;
    double x = min({a/p, b/q, c/r});
    cout << fixed << setprecision(6) << A - p * x << " " << B - q * x << " " << C - r * x;
}
int main()
{
    ios_base:: sync_with_stdio(0);
    cin.tie(0);
    if(fopen("bai1.inp","r")){
        freopen("bai1.inp","r",stdin);
    }
    inp();
    solve();
}
Leave a Comment