H. Подумаєш, комівояжер!

Вибачте, але цю сторінку ще не перекладено на українську мову For the sake of viewer convenience, the content is shown below in one of the available alternative languages. You may click one of the links to switch the site language to another available language.

2 sec, 256 M

You are given a regular N-gon. You must visit all it’s vertices only once and return into the start vertex. You may move on N-gon diagonals and edges only. No any segments of your path could be parallel. The length of the path must be as long as possible.

Input. The only input line contains a natural number N (3 ≤ N ≤ 42).

Output. If you can’t solve the task, output “Sorry, I am from ITMO” without quotas. Otherwise output N vertices in the visiting order splitting them with spaces. If there are some right paths, output your favorite one.

Input Output
3 2 1 3
4 Sorry, I am from ITMO

 

Idea – Roman Igorevich Cheplyaka
and Oleg Alexandrovich Petrov

About the post author Igor Mazurok (5 Posts)

PhD in Computer Science, Associate professor of Department Applied Mathematics of Odessa I.I.Mechnikov National University, Ukraine KBIS Software Developer

Author Info

Igor Mazurok

PhD in Computer Science, Associate professor of Department Applied Mathematics of Odessa I.I.Mechnikov National University, Ukraine
KBIS Software Developer

Leave a Reply