Intervals (1)

Write a program that, given two intervals, computes the interval
corresponding to their intersection, or tells that it is empty.

Input

Input consists of four integer numbers a₁, b₁, a₂, b₂ that represent the
intervals [a₁, b₁] and [a₂, b₂]. Assume a₁ ≤ b₁ and a₂ ≤ b₂.

Output

Print “[]” if their intersection is empty, or “[x,y]” if this is their
non-empty intersection.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:05:15.908Z

© Jutge.org, 2006–2026.
https://jutge.org
