CF44E.Anfisa the Monkey

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Anfisa the monkey learns to type. She is yet unfamiliar with the "space" key and can only type in lower-case Latin letters. Having typed for a fairly long line, Anfisa understood that it would be great to divide what she has written into k lines not shorter than a and not longer than b, for the text to resemble human speech more. Help Anfisa.

猴子安菲萨正在学习打字。她还不熟悉“空格”键,只能输入小写拉丁字母。在连续输入了相当长的一行文字后,安菲萨意识到:若将所写内容划分为 kk 行,且每行长度不小于 aa、不大于 bb,则文本会更接近人类语言的表达方式。请帮助安菲萨完成这一划分。

输入格式

The first line contains three integers k, a and b (1 ≤ k ≤ 200, 1 ≤ a ≤ b ≤ 200). The second line contains a sequence of lowercase Latin letters — the text typed by Anfisa. It is guaranteed that the given line is not empty and its length does not exceed 200 symbols.

第一行包含三个整数 kkaabb1k2001 ≤ k ≤ 2001ab2001 ≤ a ≤ b ≤ 200)。第二行包含一串小写拉丁字母——Anfisa 输入的文本。保证该行非空,且长度不超过 200 个字符。

输出格式

Print k lines, each of which contains no less than a and no more than b symbols — Anfisa's text divided into lines. It is not allowed to perform any changes in the text, such as: deleting or adding symbols, changing their order, etc. If the solution is not unique, print any of them. If there is no solution, print "No solution" (without quotes).

输出 k 行,每行包含不少于 a 个且不多于 b 个字符——即安菲萨的文本被划分成的行。不允许对文本进行任何修改,例如:删除或添加字符、改变字符顺序等。若解不唯一,输出任意一个解即可;若无解,则输出 "No solution"(不含引号)。

输入输出样例

  • 输入#1

    3 2 5
    abrakadabra

    输出#1

    ab
    rakad
    abra
  • 输入#2

    4 1 2
    abrakadabra

    输出#2

    No solution

输入解题思路,AI测评打分。不知道怎么写?

首页