« first day (7 days earlier)    last day (15 days later) » 

9:46 AM
Basically, setting    		int aRank = a.rank(),
			bRank = b.rank(),
			rank = aRank + bRank;`, the easiest case to get out of the way is `if (a.value == b.value) {
			if (rank == k)
				return a.value;
			return rank < k
				? kth(a.children[1], b.children[1], k - rank)
				: kth(a.children[0], b.children[0], k);
		}`
Then, I'm thinking of swapping a&b if a bigger and
		// a.value < b.value
		if (k < rank) { // not to the right of both
			return k < aRank // to the left of both
				? kth(a.children[0], b.children[0], k)
				// to the left of the bigger key
				: kth(a, b.children[0], k); //short-loop possible here
		}
		// not to the left of both
		return size - b.children[1].size < k // to the right of both
			? kth(a.children[1], b.children[1], k - rank)
			// to the right of the smaller key
			: kth(a.children[1], b, k - aRank);
 
10:11 AM
The tedium would be jotting down all the one- and two-node cases for lack of a bright idea how to avoid that.
Then, there'd be The Analysis.
 

« first day (7 days earlier)    last day (15 days later) »