AtCoder Beginner Contest 196
翻译中…
Problem Statement
翻译中…
Given are integers $a$, $b$, $c$, and $d$.
We will choose integers $x$ and $y$ such that $a ≤ x ≤ b$ and $c ≤ y ≤ d$. Find the maximum possible value of $x - y$ here.
翻译中…
Constraints
翻译中…
- All values in input are integers.
$-100 ≤ a ≤ b ≤ 100$$-100 ≤ c ≤ d ≤ 100$
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
a b
c d
翻译中…
Output
翻译中…
Print the answer.
翻译中…
样例
Input #1
0 10
0 10
Output #1
10
$(x, y) = (10, 0)$ achieves the maximum value $x - y = 10$.
Input #2
-100 -100
100 100
Output #2
-200
Input #3
-100 100
-100 100
Output #3
200
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。