Intersection

Let a,b,c,da, b, c, d be integers such that aba\le b and cdc\le d. Write a function @intersection(a, b, c, d)@ that assuming that intersection of intervals [a,b][a, b] and [c,d][c, d] is non empty returns the tuple of integers (p,q)(p, q) such that [p,q]=[a,b][c,d][p, q] = [a, b] \cap [c, d].

Sample session

Problem information

Author: ProAl

Generation: 2026-01-25T17:33:23.697Z

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