#122. 数字6的判断
数字6的判断
Number 6 Check
Background
Dawei is currently studying the properties of numbers. He has discovered some interesting characteristics of the number and wants you to help him write a program to determine if two integers satisfy specific conditions related to .
Problem Description
The number is a truly great number. Given two integer values, and , return true if either one is . Or if their sum is or their difference's absolute value is . Otherwise, return false.
Note: The function Math.abs(num) computes the absolute value of a number.
Input Format
The input consists of two integers and , separated by a space.
Output Format
Output true if the conditions are met, otherwise output false.
trueorfalse
Sample
6 4
true
4 5
false
1 5
true
Sample Explanation
- Sample 1: . Since is , return
true. - Sample 2: . is not , and is not . . . So return
false. - Sample 3: . is not , and is not . . Since their sum is , return
true.
Constraints
For all test cases: Time limit: 1 second, Memory limit: 1024 KB.