Given an array a[1] .. a[n] of names and ages, so that each element a[k] is a pair,
a[k] = (string "Name", int age)
Given indexes L and R such that
1 <= L < R <= n.
Sort the subarray a[L] .. a[R] in increasing order of names (or nondecreasing order if some names are equal), but do not change the position of names outside of this sub-array. The sort should be stable, namely, if two names are equal, then you may not interchange their positions.
Input. The value of n, L, and R on the first line, followed by one pair of values per line: name comma age. For example.
5 2 5 Chua Sandra Jean, 20 Vidal Eric, 21 Sarmenta Luis, 35 Sarmenta Luis, 37 Tan-Rodrigo Mercedes, 36
Output. The entire array, printed out one name-age pair per line, with the subarray sorted as required, and the rest of the array left alone untouched.