Two warehouses each keep a sorted (non-decreasing) log of shipment values: warehouse A has n values and warehouse B has m values. If the two logs were merged into one sorted list of n + m values, find the k-th smallest value in that merged list (1-indexed).
Input format
Line 1: three integers n, m, and k.
Line 2: n space-separated integers, sorted non-decreasing — warehouse A's log.
Line 3: m space-separated integers, sorted non-decreasing — warehouse B's log.
Output format
A single integer: the k-th smallest value among all n + m values combined.
Constraints
- 1 ≤ n, m ≤ 100000
- 1 ≤ k ≤ n + m
- -1000000000 ≤ each value ≤ 1000000000
- Both logs are individually sorted in non-decreasing order.