Tightest Calibration Band Across Models
You evaluate k models on a shared benchmark. Each model emits a sorted list of confidence scores. You want the narrowest score band [lo, hi] that contains at least one score from every model — the tightest interval where all models agree they have a sample.
Problem
Given k lists of integers, each individually sorted in ascending order, find the smallest range [a, b] such that every one of the k lists has at least one number within [a, b]. A range [a, b] is smaller than [c, d] if b - a < d - c, or (b - a == d - c and a < c).
Input
An integer k followed by k sorted lists of integers (lengths may differ; values may be negative).
Output
Two integers a and b — the inclusive bounds of the smallest covering range.
Constraints
- 1 ≤ k ≤ 3500
- 1 ≤ total numbers ≤ 1e5
- -1e5 ≤ value ≤ 1e5
- Each list is sorted ascending.
Examples
Example 1
Input
k=3 [4,10,15,24,26] [0,9,12,20] [5,18,22,30]
Output
20 24
[20,24] contains 24 (list1), 20 (list2), 22 (list3). Width 4 — no narrower band covers all three.
Example 2
Input
k=2 [1,2,3] [1,2,3]
Output
1 1
Both lists contain 1, so the zero-width band [1,1] covers everything.