#1928 The Rascal Triangle

5 s   128 MB  

Description

문제 링크 (pdf)

Sample Input

Sample Output

5
1 4 0
2 4 2
3 45678 12345
4 12345 9876
5 34567 11398
1 1
2 5
3 411495886
4 24383845
5 264080263

Source

2011 ACM-ICPC Greater New York Region