Do you like the saxophone? I have an Eb Alto Saxophone. My fingers move A LOT when playing some music, and I'm quite interested in how many times each finger presses the button. Assume that the music is composed of only 8 kinds of note. They are: C D E F G A B in one octave and C D E F G A B in a higher octave. We use c, d, e, f, g, a, b, C, D, E, F, G, A, B to represent them. The fingers I use for each note are:
(Note that every finger is controlling a specified button, different fingers are controlling different buttons.)
Write a program to help count the number of times each finger presses the button. A finger presses a button if it is needed in a note, but not used in the last note. Also, if it is the first note, every finger required presses the button.
The first line of the input is a single integer (), indicating the number of test cases. For each case, there is only one line containing the song. The only allowed characters are , , , , , , , , , , , , , . There are at most 200 notes in a song, and the song may be empty.
For each test case, print 10 numbers indicating the number of presses for each finger. Numbers are separated by a single space.
範例輸入 1
3 cdefgab BAGFEDC CbCaDCbCbCCbCbabCCbCbabae
範例輸出 1
0 1 1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 0 1 8 10 2 0 0 2 2 1 0
Pro 專屬功能: 查看這題在歷屆 CPE 出現過幾次 — 升級以解鎖.
cdefgabCDEFGAB