ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Kovrov IT > задача:


50382 - Parkside's Other Triangle

Гость
• Вопросы к жюри (1)

Задачи сборника

• 50371 - Modified Karnaugh-Map
• 50382 - Parkside's Other Triangle
• 50413 - Valid Permutations
• 50406 - Draw Pattern 178
• 50861 - The largest Student Group
• 50418 - Student averages
• 50420 - Teachers Sightseeing
• 50384 - Permutations revisited
• 50841 - My grand-grand-grandfather
• 50395 - Page "Like" Averages

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
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