We do Algebra, Geometry, Matrix, Trigonometry, Calculus, Vector, Permutation - Combination, Probability, Function, Graph and many more maths in our college life. Our life sucks with these maths. Now we feel math as a freaky subject. Let’s go hiking on the world of highschool maths. Where there was no fear for maths. There was just love.

#include<stdio.h>
int main() {
int a, b, c, d, e;
scanf("%d %d %d", &a, &b, &c);
d = b + c;
b = a * b/d;
c = a * c/d;
printf("%d %d", b, c);
return 0;
}

#include<iostream>
using namespace std;
int main()
{
unsigned long long n,m,r,div,mul2,mul,sum;
cin>>n>>m>>r;
sum=m+r;
div=n/sum;
mul=div*m;
mul2=div*r;
cout<<mul<<" "<<mul2<<endl;
}

You’ll get CompilationError on this code. But I saw your original submission. Did you checked your code with the previous comment’s input? Your code fails there. Now find a solution.

#include <stdio.h>
int main(){
long long x, m, n, temp;
scanf("%lld%lld%lld",&x,&m,&n);
temp=x/(m+n);
m=m*temp;
n=n*temp;
printf("%lld %lld\n",m,n);
return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
long long int x,m,n,mult;
cin>>x>>m>>n;
mult=x/(m+n);
cout<<mmult<<" "<<nmult<<endl;
return 0;
}

why the testcase 7 is wrong? I got the same ans as u.