61.6k views
2 votes
A new Hanging Bridge is constructed in the Coimbatore city. Visitors will be able to walk 200 ft on the bridge, hanging around 50 ft above the ground, and enjoy a wide-angle view of the breathtaking greenery. There is a limit on the maximum number of people on the bridge and Rahul, the manager has to now ensure the count of people on the bridge currently should not exceed the limit. He then approximately estimated that C adults and D kids who came to the show, were on the hanging bridge. He also noticed that there are L legs of the people touching the bridge. Rahul knows that kids love to ride on the adults and they might ride on the adults, and their legs won't touch the ground and hence he would miss counting their legs. Also Rahul knew that the adults would be strong enough to ride at max two kids on their back. Rahul is now wondering whether he counted the legs properly or not. Specifically, he is wondering is there some possibility of his counting being correct. Please help Rahul in finding it. Input Format Three space separated integers C, D, L denoting number of the adults, number of the kids and number of legs of people counted by Rahul, respectively. Output Format Display Yes/No according to the situation.

User Walves
by
7.6k points

1 Answer

4 votes

Final answer:

The problem can be solved using basic mathematical inequalities. If the number of legs that Rahul counted falls within this range, his count could be correct. The operational range is obtained considering that each person (adult or kid) contributes 2 legs, and each adult can carry at most 2 kids.

Step-by-step explanation:

This problem boils down to a mathematical equation. We can start by considering that each adult and each kid have 2 legs. But since some of the kids might be riding on the backs of the adults, not all of their legs would be counted. A single adult can carry at most 2 kids.

Let's assume C as the number of adults, D as the number of kids and L as the number of legs counted. Each adult contributes 2 legs, so the minimum count of legs would be 2*C. The maximum count of legs would be 2*(C+D) as each person, whether a kid or an adult, has 2 legs.

We can then create the following inequality to validate Rahul's count: if 2*C <= L <= 2*(C+D), then Rahul's count could be correct. If the number of legs counted, L, falls within this range, we can say 'Yes'. If L falls outside of this range, we can say 'No'.

Learn more about Inequality problem

User Kiuma
by
8.0k points