UVA 488

#include<stdio.h>
long abs(long x)
{
    return x>0?x:-x;
}
int main()
{
    /**//*
    freopen("data.in","r",stdin);
    freopen("data.out","w",stdout);
    //*/
    long n;
    scanf("%ld",&n);
    for(long cas=1;cas<=n;cas++)
    {
       long amp,fre;
       scanf("%ld%ld",&amp,&fre);
       for(long k=1;k<=fre;k++)
       {
          for(long i=1;i<=2*amp-1;i++)
          {
             long t=amp-abs(i-amp);
             for(long j=1;j<=t;j++)
               printf("%ld",t);
             putchar('\n');
          }
          if(cas!=n||k!=fre) putchar('\n');
       }
    }
return 0;
}

 

posted @ 2012-04-28 12:29  open your eyes  阅读(136)  评论(0编辑  收藏  举报