Logo
(追記) (追記ここまで)

32893번 - Evolving Etymology 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB116785167.105%

문제

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 $s,ドル Eelco proposes to take every second letter of $s+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 $n$ and $k$ (1ドル \leq n \leq 10^5,ドル 1ドル \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 $s$ of length $n,ドル only consisting of English lowercase letters (a-z), the original word.

출력

Output the resulting word after applying the method to the original word $k$ 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

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2024 E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /