Evolving Etymology

시간 제한1초메모리 제한1024 MB

요약
문자열 s에 매 단계마다 s+s의 짝수 번째 위치 글자를 모으는 변환을 k번 적용한 결과를 구한다. k는 10^18까지 커질 수 있다.
난이도

보통10점 중 7점

유형
수학, 문자열, 정수론, 구현
정답자
아직 제출이 없습니다

문제

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.

To make a new word from an existing word ss, Eelco proposes to take every second letter of s+ss+s, starting with the first letter. For example, applying this method to the word "etymology" would result in "eyooytmlg". 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 nn and kk (1≤n≤1051 \leq n \leq 10^5, 1≤k≤10181 \leq k \leq 10^{18}), the length of the original word and the number of times to apply the method.
  • One line with a string ss of length nn, only consisting of English lowercase letters (a-z), the original word.

출력

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

예제4

  1. 예제 1

    입력
    9 1
    etymology
    
    예상 출력
    eyooytmlg
    
  2. 예제 2

    입력
    4 1
    word
    
    예상 출력
    wrwr
    
  3. 예제 3

    입력
    5 1000000000000000000
    delft
    
    예상 출력
    delft
    
  4. 예제 4

    입력
    5 5
    eceol
    
    예상 출력
    eelco