44E.md (1358B)
1 Source: https://codeforces.com/problemset/problem/44/E 2 3 E. Anfisa the Monkey 4 5 time limit per test 6 7 2 seconds 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 stdin 16 17 output 18 19 stdout 20 21 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. 22 23 Input 24 25 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. 26 27 Output 28 29 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). 30 31 Examples 32 33 Input 34 35 ``` 36 3 2 5 37 abrakadabra 38 ``` 39 40 Output 41 42 ``` 43 ab 44 rakad 45 abra 46 ``` 47 48 Input 49 50 ``` 51 4 1 2 52 abrakadabra 53 ``` 54 55 Output 56 57 ``` 58 No solution 59 ```