#include<bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef pair < int , int > pii;

#define rep(i , l , r) for (int i = (l); i < (r); ++i)

#define mp make_pair
#define F first
#define S second

const int MN = 3e5 + 5 , LOG = 20;

int N , A[MN] , lg[MN] , st[MN][LOG] , pre[MN] , dp[MN];
vector < pii > foo;

inline int query(int l , int r) {
	int k = lg[r - l + 1];
	return max(st[l][k] , st[r - (1 << k) + 1][k]);
}

int main() {
	 
	 int T; scanf("%d" , &T);
	 for (int i = 2; i < MN; ++i)
	 	 lg[i] = lg[i >> 1] + 1;
	 while (T--) {
	 	 scanf("%d" , &N);
	 	 for (int i = 1; i <= N; ++i) scanf("%d" , &A[i]);
	 	 for (int i = 1; i <= N; ++i) pre[i] = -1;
	 	 for (int i = 1; i <= N; ++i) st[i][0] = min(N , i + A[i]);
	 	 for (int j = 1; j < LOG; ++j) for (int i = 1; i + (1 << j) - 1 <= N; ++i) 
	 	 	 st[i][j] = max(st[i][j - 1] , st[i + (1 << (j - 1))][j - 1]);
	 	 foo.clear(); foo.emplace_back(mp(dp[0] , 0));
	 	 for (int i = 1; i <= N; ++i) {
	 	 	 if (dp[i - 1] < i) dp[i] = dp[i - 1];
			 else dp[i] = max(dp[i - 1] , min(N , i + A[i]));
			 int where = lower_bound(foo.begin() , foo.end() , mp(i - A[i] - 1 , 0)) - foo.begin();
			 if (where != foo.size()) {
			 	 int val = foo[where].F;
			 	 if (foo[where].S == i - 1) val = max(val , i - 1);
			 	 else val = max(val , query(foo[where].S + 1 , i - 1));
			 	 if (val > dp[i]) pre[i] = foo[where].S , dp[i] = val;
			 }	 
			 if (dp[i] > foo.back().F) foo.emplace_back(mp(dp[i] , i));
		 }
		 if (dp[N] != N) {
		 	 printf("NO\n");
		 	 continue;
		 }
		 printf("YES\n");
		 int cur = N; vector < char > ans; ans.clear();
		 while (cur) {
		 	 if (pre[cur] == -1) {
		 	 	 ans.emplace_back('R');
				 --cur; continue;	 
			 }
			 ans.emplace_back('L');
			 for (int i = pre[cur] + 1; i < cur; ++i)
			 	 ans.emplace_back('R');
			 cur = pre[cur];
		 }
		 for (int i = (int) ans.size() - 1; ~i; --i) putchar(ans[i]);
		 printf("\n");
	 }
     return 0;
}
