Its the World Cup Finals. Chef only finds a match interesting if the skill difference of the competing teams is less than or equal to D.
Given that the skills of the teams competing in the final are X and Y respectively, determine whether Chef will find the game interesting or not.
For every test case we are given 3 space seperated integers, the first two denoting the skill levels of two teams & the third being the maximum permissible skill difference for the game to be interesting.
For the purpose of this question X & Y are interchangable since only the skill difference between the teams is of our interest, hence we need to evaluate the absolute difference between these 2 values.
- When (X>Y) then the absolute difference = (X-Y)
- Otherwise the absolute difference = (Y-X)
If the above calculated difference is more than D then the game is NOT INTERESTING else it is INTERESTING.
O(1) for each test case.