407114: GYM102697 085 Pattern Two

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

085. Pattern Twotime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Though you may have completed the previous task to analyze and find patterns in sections of text, the FBI has realized that it needs a more powerful program that is able to find more complex patterns and with more constraints. Your new program should be able to identify if a repetition pattern exists within a string regardless of where it starts. You will also be supplied with a number that represents how many repeats there should be. Your program should only output "True" if the number of repetitions precisely matches the number provided.

Input

The first line contains the string to be analyzed. The second line contains a single integer that represents the number of repetitions to look for.

Output

A single statement of "True" or "False" that indicates whether or not a repetition pattern exists with the repeat number provided.

ExampleInput
uyboubawlefjbasdHELLOHELLOHELLOHELLOsygvfubklkj
4
Output
True
Note

There can be unneeded text before and after the repetition, and this should be ignored.

加入题单

上一题 下一题 算法标签: