#886
Bronze II
TAJNA
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Every evening, little Ivica sends secret messages to little Marica through e-mail. Knowing Ivica's e-letter travels unguarded through the network on its way to Marica's e-mailbox, they have decided to encrypt every message using the following algorithm:

  • Suppose Ivica's message consists of N characters.

  • Ivica must first find a matrix consisting of R rows and C columns such that R ≤ C and

R·C = N. If there is more than one such matrix, Ivica chooses the one with the most rows.

  • Ivica writes his message into the matrix in row-major order. In other words, he writes the first

segment of the message into the first row, the second segment into the second row and so on.

  • The message he sends to Marica is the matrix read in column-major order.

Marica has grown tired of spending her precious time deciphering Ivica's messages, so you must write a program to do it for her.

입력

The input contains the received message, a string of lowercase letters of the English alphabet (with no spaces). The number of letters will be between 1 and 100.

출력

Output the original (decrypted) message.

예제 입력 1

bok

예제 출력 1

bok

예제 입력 2

koaski

예제 출력 2

kakosi

예제 입력 3

boudonuimilcbsai

예제 출력 3

bombonisuuladici
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Bronze II1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.