Intersection (2)

Let a, b, c, d be integers such that a ≤ b and c ≤ d. Write a function
@intersection2(a, b, c, d)@ that computes the intersection of intervals
[a, b] and [c, d]. When the intersection is non empty the function has
to return tuple (True, p, q) where integers p and q are such that
[p, q] = [a, b] ∩ [c, d]. If the intersection is empty, the function
must return tuple (False, 1, 0)

Sample session

Problem information

Author: ProAl

Generation: 2026-01-25T19:44:09.558Z

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