HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > IMPC - 2013-2014 > problem:


14-03-60. 50382 - Parkside's Other Triangle

IMPC - 2013-2014

Start: Mar.16.2013 at 12:00:00 PM
Finish: Mar.16.2013 at 05:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 50386 - Conformity
• 14-01-10. 50457 - The Number of W...
• 14-01-40. 50419 - The longest bitoni...
• 14-01-50. 50795 - Trunk
• 14-03-10. 50412 - K numbers
• 14-03-20. 50398 - Sum of kth Anti-d...
• 14-03-30. 50377 - kth Permutation
• 14-03-40. 50773 - Balanced Sum Tree
• 14-03-60. 50382 - Parkside's O...
• 14-03-70. 50468 - Draw Matrix - 2
• 14-03-70. 50468 - Draw Matrix - 2
• 14-03-80. 50675 - Kruja Boys
• 14-03-90. 50717 - Hurdle Jumping
• 14-04-20. 50493 - n-digit kth Prime ...
• 14-04-30. 50669 - Area of an Irregu...
• 14-04-40. 50712 - Moon algebra
• 14-04-50. 50697 - Base Stations

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Taken from USACO.

Parkside's Other Triangle

Parkside's Other Triangle is generated from two positive integers, one for the size and one for the seed. For example,

  Size 4, Seed 3
  3 4 6 9
    5 7 1
      8 2
        3

Size gives the number of columns. Seed specifies the starting value for column 1. Columni contains i values. The first number is the seed. Then each succesive number is produced by adding one. The numbering continues in every column. When numbering reaches to 9, the value continues from 1. When numbering in a column reaches to end, it continues from the next column.

Question: Write a program that reads a pair of positive integers and produces Parkside's Other Triangle.

Input specification
You will be given two integer numbers, number of columns and the seed (numCols and seed) where 1 ≤ numCols ≤ 20 and 1 ≤ seed ≤ 9.

Output specification
Show the given Parkside's other triangle. Each number is followed by a space and every rowi contains (i-1)*2 spaces.

Sample Input   
6 2
Sample Output   
2 3 5 8 3 8
  4 6 9 4 9
    7 1 5 1
      2 6 2
        7 3
          4

Для отправки решений необходимо выполнить вход.

www.contester.ru