#include<bits/stdc++.h>
#define i64 long long
#define mx(a,b,c) max(a,max(b,c))
#define mn(a,b,c) min(a,min(b,c))
#define eef else if
#define ff(i,s,e) for(int i=(s); i<e; i++)
#define ff2(i,s,e) for(int i=(s); i>=e; i--)
#define sf scanf
#define pf printf
#define dbug(x) cout<<"x = "<<x<<endl
#define newl cout<<"\n"
using namespace std;
i64 loop(i64 x)
{
ff(i,1,x+1){
ff(j,0,i)
cout<<i;
newl;
}
}
i64 rev(i64 x)
{
ff2(k,x-1,1){
ff2(l,k,1)
cout<<k;
newl;
}
}
int main()
{
int cse=0,cnt=0,flg=0;
i64 h , w;
int t,print=0;
cin>>t;
int temp=t;
while(t--){
cin>>h>>w;
++print;
ff(m,0,w){
loop(h);
rev(h);
if(m!=w-1)
newl;
}
if(print!=temp)
newl;
}
return 0;
}
#define i64 long long
#define mx(a,b,c) max(a,max(b,c))
#define mn(a,b,c) min(a,min(b,c))
#define eef else if
#define ff(i,s,e) for(int i=(s); i<e; i++)
#define ff2(i,s,e) for(int i=(s); i>=e; i--)
#define sf scanf
#define pf printf
#define dbug(x) cout<<"x = "<<x<<endl
#define newl cout<<"\n"
using namespace std;
i64 loop(i64 x)
{
ff(i,1,x+1){
ff(j,0,i)
cout<<i;
newl;
}
}
i64 rev(i64 x)
{
ff2(k,x-1,1){
ff2(l,k,1)
cout<<k;
newl;
}
}
int main()
{
int cse=0,cnt=0,flg=0;
i64 h , w;
int t,print=0;
cin>>t;
int temp=t;
while(t--){
cin>>h>>w;
++print;
ff(m,0,w){
loop(h);
rev(h);
if(m!=w-1)
newl;
}
if(print!=temp)
newl;
}
return 0;
}
No comments:
Post a Comment