TSECJC01 - Editorial

PROBLEM LINK:

Practice

Contest

Author: tseccodecell

DIFFICULTY:

Cakewalk

PREREQUISITES:

None

PROBLEM:

The problem is to find whether Chef can cover a distance D kilometres in time H hours while traveling at L km/hr

QUICK EXPLANATION:

Speed=Distance/Time. There Distance=Speed*Time.

EXPLANATION:

Ideally, Chef will always drive at the fastest possible speed, that is, the speed limit. Doing so, he will cover a distance of L*H kilometres. If this distance is more than or equal to D, he can reach the stadium on time. The condition becomes L*H>=D for ‘Yes’. The equation can also be rearranged as L>=D/H or H>=D/L, assuming the numbers are properly converted to float. The first formula is preferred to avoid precision errors.

SOLUTION:

Author’s

Tester’s