Problem:
Score : 200 points

Problem Statement

A string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:

S is a palindrome.

Let N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.

The string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.

Determine whether S is a strong palindrome.

Constraints

S consists of lowercase English letters.

The length of S is an odd number between 3 and 99 (inclusive).

Input

Input is given from Standard Input in the following format:

S

Output

If S is a strong palindrome, print Yes;
otherwise, print No.

Sample Input 1

akasaka

Sample Output 1

Yes

S is akasaka.

The string formed by the 1-st through the 3-rd characters is aka.

The string formed by the 5-th through the 7-th characters is aka.
All of these are palindromes, so S is a strong palindrome.

Sample Input 2

level

Sample Output 2

No

Sample Input 3

atcoder

Sample Output 3

No

Solution in C (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int palindrome( char *s, int k, int n ){
    // 変数宣言
    int i;
    int result = 0;
    int result_total[100];
    int sum = 0;

    // 初期化
    for( i = 0; i < 99 ; i++ ){
        result_total[i] = 0;
    }
    
    // 回文判定
    for( i = 0 ; i < n ; i++ ){
        if( s[i] == s[( n - 1 )- i ] ){
            result_total[i] = 1; 
        }
    }

    // 判定結果の総和
    for( i = 0; i < n ; i++ ){
        sum += result_total[ i ];
    }

    // 結果判定
    if( sum == n ){
        result = 1;
    }

    return result;
}

int palindrome_end( char *s, int k, int n ){
    // 変数宣言
    int i;
    int result = 0;
    int result_total[51];
    int sum = 0;

    // 初期化
    for( i = 0; i < 50 ; i++ ){
        result_total[i] = 0;
    }
    
    // 回文判定
    for( i = 0 ; (( n + 3 ) / 2 ) - 1 < n - i ; i++ ){
        if( s[ k + i ] == s[(( n - 1 ) - i )] ){
            result_total[i] = 1; 
        }
    }

    // 判定結果の総和
    for( i = 0; i < n ; i++ ){
        sum += result_total[ i ];
    }

    // 結果判定
    if( sum == ( n - 1 ) / 2 ){
        result = 1;
    }

    return result;
}

int main(void){
    // 変数宣言
    int n = 0, k = 0;
    char s[99];
    int i;
    char *result = "No";
    int result_all = 0, result_start = 0, result_end = 0;

    // 入力処理
    scanf( "%s", s );

    // 演算処理
    n = strlen( s );

    // 文字列sの回文判定
    result_all = palindrome( s, 0, n );

    // 強い回文か判定（１）
    result_start = palindrome( s, 0, (( n - 1 ) / 2 ));

    // 強い回文か判定（２）
    
    result_end = palindrome_end( s, (( n + 3 ) / 2 ) - 1, n );

    // 結果条件判定
    if( result_all == 1 && result_start == 1 && result_end == 1 ){
        result = "Yes";
    }

    // 出力
    printf( "%s", result );
    
    
    return 0;
}