Consider a square sitting in Quadrant I as depicted in an example below:
This square is to be split into two regions (e.g., red and blue). Given the ratio between the two regions and the side of the square, determine the x coordinate of the line that splits the regions. The ratio between the regions (red to blue) is presented through the first two entries in the input. For example, if the ratio is 7 to 11, then these two numbers will be the first two numbers in the input. The last entry is the side of the square.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers76
Suggested Problems
-
16795 Solvers
-
Create a vector whose elements depend on the previous element
795 Solvers
-
368 Solvers
-
3152 Solvers
-
630 Solvers
More from this Author180
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
I get all correct answers, but still it shows tests 2 , 4 & 5 is not passed, even though values are same
@VBBV This is due to floating point arithmetic and rounding - the test suite is very strict. Try adapting your code.