Question: You are given 2 arrays sorted in decreasing order of size m and n respectively.

Input: a number k <= n*n and >= 1

Output: the kth largest sum(a+b) possible. where
a (any element from array 1)
b (any element from array 2)

Solution: The kth largest sum means, either
1. make complete list and sort and find the kth element
2. start and make the list in sorted order, so you stop at kth element.

Approach-2 is good.
Take 3 pointers, Keep track of next pair of ai in bi
P1 a1 b1
P2 a2 b2
P3 a3 b3
a4 b4
a5 b5

Pair 1 a1 b1
P1 For a1 next pair is a1 b2
P2 For a2 next pair is a2 b1
P3 For a3 next pair is a3 b1

Pair 2 if a1 b2 > a2 b1 = a2 b1
P1 For a1 next pair is a1 b2
P2 For a2 next pair is a2 b2
P3 For a3 next pair is a3 b1

Pair 3 Min[a1 b2, a2 b2, a3b1] = a3 b1
P1 For a1 next pair is a1 b2
For a2 next pair is a2 b2 [Ignore] a1 b2 is smaller
For a3 next pair is a3 b2 [Ignore] a1 b2 is smaller
P2 For a4 next pair is a4 b1
P3 NULL

Pair 4 Min[a1 b2, a4 b1]