سلام به همگی کسی میتونه این رو حل کنه؟؟؟؟؟؟؟ یه توضیح کوچولو هم اگه بدین خوب میشه.
Consider a word w consisting of n symbols. We can decompose it at point i (1 ≤ i ≤ n − 1) into a prefix p of length i and a suffix s of length n − i. Local root of a word w at point i is a non-empty word r such that:
- p is a suffix of r, or r is a suffix of p, or r is equal to p;
- s is a prefix of r, or r is a prefix of s, or r is equal to s;
- r has minimal possible length.
Your goal is to find such a point that the length of local root at this point is maximal possible.
Input
The only line contains a word w consisting of lowercase English letters. Its length is at least two and at most 300 000 symbols.
Output
Output the required point of decomposition and the length of local root at this point. If there are several possible answers, output any of them.
ریشه های محلی:
W کلمه متشکل از نمادهای N را در نظر بگیرید.ما می توانیم آن را در نقطه تجزیه (1 ≤i ≤ N - 1) به پیشوند P از طول i و یک پسوندs ازطولN -i ریشه محلی W کلمه در نقطه i یک کلمه غیر تهی R هستبه طوری که:
P پسوندR است، و یا R پسوندP است ، یا R بهP برابر است؛
s یک پیشوندR، R یک پیشوند از S یاR تا S برابر است؛
R دارای طول حداکثر ممکن است.
هدف شما پیدا کردن یک نقطه که طول ریشه های محلی در این مرحله حداکثر ممکن است.
ورودی
خط تنها حاوی W کلمه متشکل از حروف کوچک انگلیسی. طول آن حداقل 2 و حداکثر 300000نمادها است.
خروجی
خروجی نقطه مورد نیاز از تجزیه و طول ریشه های محلی در این نقطه. اگر چندین جواب ممکن است ، خروجی هر کدام از آنها وجود دارد.