Problem A: How many substrings

Problem A: How many substrings

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1275  Solved: 782
[Submit][Status][Web Board]

Description

Give you a string, you should print how many none empty substrings it has.

Input

The first line is number of tests. T (1 <= T <= 10)

The second line is a string S. The length of S doesn’t exceed 1000, that is |S| <= 1000

S will only contain lower case English letters.

Output

For each test, you should print an integer in a single line, which is the number of none empty substrings of S.

Sample Input

1
hello

Sample Output

15

HINT

Easy problem.

[Submit][Status]