We do Algebra, Geometry, Matrix, Trigonometry, Calculus, Vector, Permutation - Combination, Probabil…
Click here to read the complete problem statement.
If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.
#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.