Module: Workshop - 4. String processing. "A little about Ancient Rome and Julius Caesar"

Problem

3
/6

Education in ancient Rome

Problem

Education in Ancient Rome was important in the life of the Romans. The rich people of Ancient Rome believed in the necessity and importance of education. The poor inhabitants of Rome did not have the opportunity to get an education, but many learned to read and write on their own.

There were two types of schools in ancient Rome. The first type – these are schools for young children up to the age of 11-12, where they learned to write, read and learned the basics of mathematics. Children of such schools could easily solve various mathematical problems, including continuing the following sequence of rows:

1

11

21

1211

111221

312211

13112221

Try and solve this problem. Think about what row will be next.
Write a program to solve the problem.

Input
The input is two space-separated integers: x (\(0 <= x <=100\)) - the first member sequences and n (\(1<=n<=25\)).