Codeforces Round 497 (Div. 1)
B
Pave the Parallelepiped
Codeforces
2400
原题
← AC →
翻译中…

You are given a rectangular parallelepiped with sides of positive integer lengths $A$, $B$ and $C$.

翻译中…

Find the number of different groups of three integers ($a$, $b$, $c$) such that $1\leq a\leq b\leq c$ and parallelepiped $A\times B\times C$ can be paved with parallelepipeds $a\times b\times c$. Note, that all small parallelepipeds have to be rotated in the same direction.

翻译中…

For example, parallelepiped $1\times 5\times 6$ can be divided into parallelepipeds $1\times 3\times 5$, but can not be divided into parallelepipeds $1\times 2\times 3$.

翻译中…

Input

翻译中…

The first line contains a single integer $t$ ($1 \leq t \leq 10^5$) — the number of test cases.

翻译中…

Each of the next $t$ lines contains three integers $A$, $B$ and $C$ ($1 \leq A, B, C \leq 10^5$) — the sizes of the parallelepiped.

翻译中…

Output

翻译中…

For each test case, print the number of different groups of three points that satisfy all given conditions.

翻译中…

Note

翻译中…

In the first test case, rectangular parallelepiped $(1, 1, 1)$ can be only divided into rectangular parallelepiped with sizes $(1, 1, 1)$.

翻译中…

In the second test case, rectangular parallelepiped $(1, 6, 1)$ can be divided into rectangular parallelepipeds with sizes $(1, 1, 1)$, $(1, 1, 2)$, $(1, 1, 3)$ and $(1, 1, 6)$.

翻译中…

In the third test case, rectangular parallelepiped $(2, 2, 2)$ can be divided into rectangular parallelepipeds with sizes $(1, 1, 1)$, $(1, 1, 2)$, $(1, 2, 2)$ and $(2, 2, 2)$.

翻译中…

样例

Input #1
4
1 1 1
1 6 1
2 2 2
100 100 100
Output #1
1
4
4
165
InputCopy OutputCopy
题目信息
题号
1007B
时间限制
2 s
内存限制
256 MB
标签
位运算
暴力
组合数学
数学
数论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。