#include<iostream>
using namespace std;
int main()
{
int a, n, m, i, j, t;
while(cin >> a)
{
for(t=1;t<=a;t++)
{
cin >> n;
cin >> m;
while(m > 0)
{
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
cout << i;
}
cout << endl;
}
for(i=n-1;i>=1;i--)
{
for(j=i;j>=1;j--)
{
cout << i;
}
cout << endl;
}
if( t != a || m != 1)
cout << endl;
m--;
}
}
}
return 0;
}
using namespace std;
int main()
{
int a, n, m, i, j, t;
while(cin >> a)
{
for(t=1;t<=a;t++)
{
cin >> n;
cin >> m;
while(m > 0)
{
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
cout << i;
}
cout << endl;
}
for(i=n-1;i>=1;i--)
{
for(j=i;j>=1;j--)
{
cout << i;
}
cout << endl;
}
if( t != a || m != 1)
cout << endl;
m--;
}
}
}
return 0;
}
Comments
Post a Comment