Atenţie! Aceasta este o versiune veche a paginii, scrisă la 2021-12-20 21:06:41.
Revizia anterioară   Revizia următoare  

 

Fişierul intrare/ieşire:kalindrome.in, kalindrome.outSursăIIOT 2021-22 Runda 2
AutorWilliam Di LuigiAdăugată destefdascalescuStefan Dascalescu stefdascalescu
Timp execuţie pe test0.5 secLimită de memorie16384 kbytes
Scorul tăuN/ADificultateN/A

Vezi solutiile trimise | Statistici

Kalindrome

William loves strings and their properties, and he is especially fond of palindromes. He likes palindromes so much, that he started reading lots of research papers on them and finally stumbled upon a new kind of property that generalizes the palindrome concept: the kalindrome.

We say that a string is a \textit{kalindrome} if, for some positive integer K, it's possible to split the string in many substrings, each of them K characters long, so that they can be ``read'' from left to right in the same way as right to left. More precisely: if we concatenate the substrings starting from the last one, we will recreate the original string.

For example: the word ``banaba'' is a kalindrome, because if we choose K=2 then we obtain the substrings: ba, na, ba, which can indeed be concatenated starting from the last one, to reconstruct the original word.

You might have noticed that, by this definition, any string is a kalindrome! That's true, in fact we could choose K to be equal to the string's length, and we would then obtain a single substring which would of course respect the definition! However, William is interested to know what's the smallest K for a given string that would prove it is a kalindrome.

Help him by writing a program that automates this test!

Date de intrare

Fişierul de intrare kalindrome.in ...

Date de ieşire

În fişierul de ieşire kalindrome.out ...

Restricţii

  • ... ≤ ... ≤ ...

Exemplu

kalindrome.inkalindrome.out
This is some
text written on
multiple lines.
This is another
text written on
multiple lines.

Explicaţie

...

Trebuie sa te autentifici pentru a trimite solutii. Click aici

Cum se trimit solutii?