You are givenarrays of positive integers. Each array is of even length.
You need to split all these integers into two equal multisets and , that is, each element of each array should go into one of two multisets (but not both). Additionally, for each of the arrays, exactly half of its elements should go into , and the rest should go into .
Give an example of such a division or determine that no such division exists.
The first line contains an integer( ) — the number of arrays.
The nextlines contain descriptions of the arrays.
For each array, the first line contains an even integer( ) — the length of the array. The second line consists of space-separated integers ( ) — array elements.
It is guaranteed that the sum ofover all arrays does not exceed .
If the answer exists, print “YES”, and then printlines.
On each line, for each element, print the letter “L” or “R” (capitalized, without spaces), depending on which multiset the element should go into.
If there is no answer, print “NO” on the only line.
3 2 1 2 4 1 2 3 3 6 1 1 2 2 3 3
YES RL LRLR RLLRRL
For the first array, we move the first element intoand the second element into . At the moment , and .
For the second array, we add the second and the third elements to, and the rest go to . Now and .
For the third array, we move elements at odd indices to, and elements at even indices go to . As a result, .