# [Baltic2015]Bowling

时间限制：10s 【提交】 空间限制：256MB

### 题目描述

### 输入格式

The first line of input contains one integer Q(1<=Q<=25), specifying the number of test cases to consider. The following 3Q lines of input contain descriptions of test cases. Each test case is described by three lines of input.

### 输出格式

Your program should output q lines, one line per each test case in the same order as in the input.

### 样例输入

2 10 08x-7/2/x?x-23??1/??? 8 -1 40 60 82 97 102 110 120 140 5 x-x-23?/00- 22 37 42 52 52

### 样例输出

9 10

### 提示

Explanation to the example: In the first case, in frame 5 after the character "x" the only possible character is "-". In frame 8 the player got 8 points in total. Thus there are 9 possibilities how this sum could have been obtained:0+8,1+7,….8+0. There were no bonus points in frame 9. Therefore, there were no points on the first shot of the final frame. To obtain 20 points in the last two shots, the only possibility is a spare with a following strike in the last shot of the frame. Therefore there are 9 different valid games which correspond to this input data.

### 题目来源

没有写明来源