F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Distinct Sub-palindromes

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 1411    Accepted Submission(s): 803


Problem Description
S is a string of length n. S consists of lowercase English alphabets.

Your task is to count the number of different S with the minimum number of distinct sub-palindromes. Sub-palindrome is a palindromic substring.

Two sub-palindromes u and v are distinct if their lengths are different or for some i (0¡Üi¡Ülength), $u_i$¡Ù$v_i$. For example, string ¡°aaaa¡± contains only 4 distinct sub-palindromes which are ¡°a¡±, ¡°aa¡±, ¡°aaa¡± and ¡°aaaa¡±.
 

Input
The first line contains an integer T (1¡ÜT¡Ü$10^5$), denoting the number of test cases.

The only line of each test case contains an integer n (1¡Ün¡Ü$10^9$).
 

Output
For each test case, output a single line containing the number of different strings with minimum number of distinct sub-palindromes.

Since the answer can be huge, output it modulo 998244353.
 

Sample Input
2 1 2
 

Sample Output
26 676
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-03 17:30:41, Gzip enabled