#252. 条件差值计算
条件差值计算
Difference Calculation
Background
Congcong has recently been learning about numerical operations. He encountered an interesting problem that requires calculating the difference between a given integer and a specific number, and doubling it under certain conditions.
Problem Description
Given an integer , return the absolute difference between and . However, if is over , return double the absolute difference.
Input Format
Input is given from standard input in the following format.
Output Format
Output is printed to standard output in the following format.
The calculated result
Sample
19
2
10
11
21
0
Sample Explanation
Sample 1: . is not greater than , so return . Sample 2: . is not greater than , so return . Sample 3: . is not greater than , so return .
Constraints
Time limit is second, and memory limit is KiB for each test case.