CF204E Little Elephant and Strings
Description
The Little Elephant loves strings very much.
He has an array $ a $ from $ n $ strings, consisting of lowercase English letters. Let's number the elements of the array from 1 to $ n $ , then let's denote the element number $ i $ as $ a_{i} $ . For each string $ a_{i} $ $ (1
Input Format
The first line contains two space-separated integers — $ n $ and $ k $ $ (1
Output Format
On a single line print $ n $ space-separated integers — the $ i $ -th number is the answer for string $ a_{i} $ .
Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.
Explanation/Hint
Let's assume that you are given string $ a=a_{1}a_{2}...\ a_{|a|} $ , then let's denote the string's length as $ |a| $ and the string's $ i $ -th character as $ a_{i} $ .
A substring $ a[l...\ r] $ $ (1