#140. 三数差值判断

    ID: 140 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatLogic-1gesp1条件结构数学基础

三数差值判断

Difference Check

Background

Congcong is currently learning about number comparisons. He encountered an interesting problem that requires determining if there is a significant difference between three numbers.

Problem Description

Given three integers a,b,ca, b, c, return true if one of them is 10 or more less than one of the others.

In other words, if ab10|a - b| \ge 10 or ac10|a - c| \ge 10 or bc10|b - c| \ge 10 holds, return true; otherwise, return false.

Input Format

Input is given from standard input in the following format.

aa bb cc

Output Format

Output is printed to standard output in the following format.

Output true if the condition is met; otherwise, output false.

Sample

1 7 11
true
1 7 10
false
11 1 7
true

Sample Explanation

Sample 1: a=1,b=7,c=11a=1, b=7, c=11. ac=111=10=10|a - c| = |1 - 11| = |-10| = 10. Since 101010 \ge 10, the condition is met, so output true.

Sample 2: a=1,b=7,c=10a=1, b=7, c=10. ab=17=6=6<10|a - b| = |1 - 7| = |-6| = 6 < 10. ac=110=9=9<10|a - c| = |1 - 10| = |-9| = 9 < 10. bc=710=3=3<10|b - c| = |7 - 10| = |-3| = 3 < 10. All differences are less than 10, so the condition is not met, output false.

Sample 3: a=11,b=1,c=7a=11, b=1, c=7. ab=111=10=10|a - b| = |11 - 1| = |10| = 10. Since 101010 \ge 10, the condition is met, so output true.

Constraints

For each test case, the time limit is 1 second, and the memory limit is 1024 KiB. The input integers a,b,ca, b, c satisfy the range of standard integer types.