Problem2161--Linear Keyboard(CF1607a)

2161: Linear Keyboard(CF1607a)

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

Sample Input Copy

5
abcdefghijklmnopqrstuvwxyz
hello
abcdefghijklmnopqrstuvwxyz
i
abcdefghijklmnopqrstuvwxyz
codeforces
qwertyuiopasdfghjklzxcvbnm
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qwertyuiopasdfghjklzxcvbnm
abacaba

Sample Output Copy

13
0
68
0
74

Source/Category