#include <iostream>
using namespace std;
int a[1000001][4];
int main()
{
int t;
cin >> t;
int s = 0, ss = 0;
for (int i = 1; i <= t; i++)
cin >> a[i][1] >> a[i][2] >> a[i][3];
for (int i = 1; i <= t; i++)
{
s = 0, ss = 0;
for (int j = 1; j <= a[i][1]; j++)
{
for (int k = 1; k <= a[i][2]; k++)
{
if (j == k && s < a[i][3] && ss <= min(a[i][1], a[i][2]))
cout << "S", s++, ss++;
else if (s + min(a[i][1], a[i][2]) <= a[i][3] && a[i][3] > min(a[i][1], a[i][2]))
cout << "S", s++;
else
cout << ".";
}
cout << endl;
}
cout << endl;
}
}
测试了好多遍不知道哪里有误,请大佬们指正,谢谢!