#pragma comment(linker,"/stack:200000000")
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define N 300005
#define int long long
using namespace std;

template <typename T>

void read(T &a)
{
	T x = 0,f = 1;
	char ch = getchar();
	while (ch < '0' || ch > '9')
	{
		if (ch == '-') f = -1;
		ch = getchar();
	}
	while (ch >= '0' && ch <= '9')
	{
		x = (x << 1) + (x << 3) + (ch ^ 48);
		ch = getchar();
	}
	a = x * f;
}

template <typename T>

void write(T x)
{
	if (x < 0) putchar('-'),x = -x;
	if (x < 10) return (void) putchar(x + '0');
	write(x / 10);
	putchar(x % 10 + '0');
}

template <typename T>

void writeln(T x)
{
	write(x);
	putchar('\n');
}

template <typename T>

void writes(T x)
{
	write(x);
	putchar(' ');
}

template <typename T,typename... Args> 

void read(T &t,Args &... args)
{
	read(t);
	read(args...);
}

template <typename T,typename... Args>

void writes(T t,Args ... args)
{
	writes(t);
	writes(args...);
}

template <typename T,typename... Args>

void writeln(T t,Args ... args)
{
	writes(t);
	writes(args...);
	putchar('\n');
}

const int inf = 0x7f7f7f7f7f7f7f;
int n,k,p[N],dp[N],pre[N];

struct Segment_Tree
{
	int maxx[N << 2];
	void pushup(int now)
	{
		maxx[now] = max(maxx[now << 1],maxx[now << 1 | 1]);
	}
	void build(int now,int l,int r)
	{
		if (l == r) return (void) (maxx[now] = min(n,p[l] + l));
		int mid = (l + r) >> 1;
		build(now << 1,l,mid);
		build(now << 1 | 1,mid + 1,r);
		pushup(now);
	}
	int query(int now,int l,int r,int ll,int rr)
	{
		if (ll <= l && rr >= r) return maxx[now];
		int mid = (l + r) >> 1,ans = -inf;
		if (ll <= mid) ans = max(ans,query(now << 1,l,mid,ll,rr));
		if (rr > mid) ans = max(ans,query(now << 1 | 1,mid + 1,r,ll,rr));
		return ans;
	}
}T;

signed main()
{
	int t;
	read(t);
	while (t--)
	{
		std::vector<pair<int,int> > v;
		read(n);
		for (int i = 1; i <= n; i++)
			read(p[i]);
		T.build(1,1,n);
		for (int i = 1; i <= n; i++)
			pre[i] = -1;
		v.push_back(make_pair(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 + p[i]));
			int it = lower_bound(v.begin(),v.end(),make_pair(i - p[i] - 1,0LL)) - v.begin();
			if (it != v.size())
			{
				int qaq = v[it].first;
				if (v[it].second == i - 1) qaq = max(qaq,i - 1);
				else qaq = max(qaq,T.query(1,1,n,v[it].second + 1,i - 1));
				if (qaq > dp[i]) pre[i] = v[it].second,dp[i] = qaq;
			}
			if (dp[i] > v.back().first) v.push_back(make_pair(dp[i],i));
		}
		if (dp[n] != n)
		{
			puts("NO");
			continue;
		}
		puts("YES");
		std::vector<char> sk;
		int u = n;
		while (u)
		{
			if (pre[u] == -1)
			{
				sk.push_back('R');
				u--;
				continue;
			}
			sk.push_back('L');
			for (int i = pre[u] + 1; i < u; i++)
				sk.push_back('R');
			u = pre[u];
		}
		while (!sk.empty()) putchar(sk.back()),sk.pop_back();
		puts("");
	}
	return 0;
}