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",&,&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; }