310701: CF1873C. Target Practice
Description
A $10 \times 10$ target is made out of five "rings" as shown. Each ring has a different point value: the outermost ring — 1 point, the next ring — 2 points, ..., the center ring — 5 points.
Vlad fired several arrows at the target. Help him determine how many points he got.
InputThe input consists of multiple test cases. The first line of the input contains a single integer $t$ ($1 \leq t \leq 1000$) — the number of test cases.
Each test case consists of 10 lines, each containing 10 characters. Each character in the grid is either $\texttt{X}$ (representing an arrow) or $\texttt{.}$ (representing no arrow).
OutputFor each test case, output a single integer — the total number of points of the arrows.
ExampleInput4 X......... .......... .......X.. .....X.... ......X... .......... .........X ..X....... .......... .........X .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ....X..... .......... .......... .......... .......... .......... XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXXOutput
17 0 5 220Note
In the first test case, there are three arrows on the outer ring worth 1 point each, two arrows on the ring worth 3 points each, and two arrows on the ring worth 4 points each. The total score is $3 \times 1 + 2 \times 3 + 2 \times 4 = 17$.
In the second test case, there aren't any arrows, so the score is $0$.
Output
输入数据格式:输入包含多个测试用例。输入的第一行包含一个整数t (1 ≤ t ≤ 1000)——测试用例的数量。每个测试用例由10行组成,每行包含10个字符。网格中的每个字符要么是X(代表一支箭),要么是.(代表没有箭)。
输出数据格式:对于每个测试用例,输出一个整数——箭的总分值。
请注意,由于您请求的是仅题目大意以及输入输出数据格式的翻译,所以具体的LaTeX格式的公式和完整的翻译未包含在内。如果您需要完整的翻译和LaTeX格式的公式,请告知。题目大意:一个10x10的目标由五个“环”组成,每个环有不同的分值:最外层环1分,下一层2分,...,中心环5分。Vlad向目标射了若干箭,帮助他确定他得了多少分。 输入数据格式:输入包含多个测试用例。输入的第一行包含一个整数t (1 ≤ t ≤ 1000)——测试用例的数量。每个测试用例由10行组成,每行包含10个字符。网格中的每个字符要么是X(代表一支箭),要么是.(代表没有箭)。 输出数据格式:对于每个测试用例,输出一个整数——箭的总分值。 请注意,由于您请求的是仅题目大意以及输入输出数据格式的翻译,所以具体的LaTeX格式的公式和完整的翻译未包含在内。如果您需要完整的翻译和LaTeX格式的公式,请告知。