logo AlgoBeat OnlineJudge
登录 注册

#213845. [NWERC 2024] Evolving Etymology

内存限制:2048 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Eelco has recently started to gain interest in the field that studies the origin of words: etymology. He especially likes how words can evolve in many different ways: pronunciation changes over time, words are borrowed from different languages, and the meaning of words can change based on culture. Eelco is eager to attend the Networking With Etymologists: Revolutionary Conference for the first time ever. To make a good first impression, he is going to present a completely new method to make new words from existing words.

:::align{center}

Van Dale Groot etymologisch woordenboek. © VanDale Uitgevers, used with permission

:::

To make a new word from an existing word , Eelco proposes to take every second letter of , starting with the first letter. For example, applying this method to the word "" would result in "". Of course, to design even more words, this process can be repeated many times. Eelco would like to prepare a list of new words to present at the conference, so he writes a program that applies his method some predetermined number of times.

输入格式

The input consists of:

  • One line with two integers and (, ), the length of the original word and the number of times to apply the method.
  • One line with a string of length , only consisting of English lowercase letters (), the original word.

输出格式

Output the resulting word after applying the method to the original word times.

样例

样例输入 1

9 1
etymology

样例输出 1

eyooytmlg

样例输入 2

4 1
word

样例输出 2

wrwr

样例输入 3

5 1000000000000000000
delft

样例输出 3

delft

样例输入 4

5 5
eceol

样例输出 4

eelco