ShahofBlah ki Madad
All submissions for this problem are available.
ShahOfBlah is a student of Blah Senior Secondary School. Sadly, as usual, he was given holiday homework by his teachers. But his Maths teacher being very impressed by him gave him some advanced topics in Maths to study during holidays. He spent day and night studying those topics to impress his teacher. Now, holidays are over and his teacher gave him a question to solve. After seeing the question, he was dumbstruck. He can’t think of how to solve this particular question. So he asks your help. Help him to solve the problem.
You will be given 4 integers n, x, y and z. You have to find the maximum value of a+b+c such that ax+by+cz=n. You can assume that there always exist an integral solution to the equation.
1 5 5 3 1
Maximum value of a+b+c=5
a=0, b=0, c=5
0*5+0*3+5*1 = 5
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP 6.3, JAVA|
Fetching successful submissions
If you are still having problems, see a sample solution here.