PLD  Palindromes
A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction, e.g. 'racecar', 'solos'.
Task
You are given a number k (2≤k≤30000) and a nonempty string S whose length does not exceed 30000 lowercase letters.
We say two palindromes are different when they start from different positions. How many different palindromes of the length k does S contains?
Input
The first line contains K. The second line contains S. K does not exceed the length of S.
Output
The first and only line should consist of a single number  the number of palindromes found.
Example
Input: 5 ababab Output: 2
hide comments
avik26091998:
20171224 07:22:01
O(n*n) accepted!!! 

vengatesh15:
20170304 14:19:19
Brute force pass..


ashishranjan28:
20170105 16:43:49
brute force :) 

minhthai:
20160311 12:12:08
try hashing if tle 

Anik Dasgupta:
20150815 17:07:35
i am getting an error in the 9th case. please help! 

Scape:
20150725 18:06:12
Can be solved in O(N). 

jose:
20141105 22:48:31
which is the case 6 or 7


Fahim Zubayer:
20130507 15:02:39
Guess what? O(N log(N)^2) works!


Divya Gupta:
20130325 08:37:28
gives tle 

Divya Gupta:
20130317 09:34:53
time limit eceeds

Added by:  Chinh Nguyen 
Date:  20080207 
Time limit:  0.100s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 