#155. 最接近21且不超过21的值
最接近21且不超过21的值
Nearest to 21
Background
This is a simple number game where you need to determine which number is closer to a target value based on given rules.
Problem Description
Given two integer values greater than , return whichever value is nearest to without going over. Return if they both go over.
Input Format
Input consists of two integers, separated by a space.
Output Format
Output a single integer, representing the value nearest to without going over, or .
result
Sample
19 21
21
21 19
21
19 22
19
Sample Explanation
- Sample 1: Given and . is nearest to and does not go over.
- Sample 2: Given and . is nearest to and does not go over.
- Sample 3: Given and . does not go over , while does. Thus, is returned.
Constraints
Time limit for each test case is second, and memory limit is KiB.