You are given a rectangular parallelepiped with sides of positive integer lengths AA, BB and CC.
Find the number of different groups of three integers (aa, bb, cc) such that 1≤a≤b≤c1≤a≤b≤c and parallelepiped A×B×CA×B×C can be paved with parallelepipeds a×b×ca×b×c. Note, that all small parallelepipeds have to be rotated in the same direction.
For example, parallelepiped 1×5×61×5×6 can be divided into parallelepipeds 1×3×51×3×5, but can not be divided into parallelepipeds 1×2×31×2×3.
For each test case, print the number of different groups of three points that satisfy all given conditions.
In the first test case, rectangular parallelepiped (1,1,1)(1,1,1) can be only divided into rectangular parallelepiped with sizes (1,1,1)(1,1,1).
In the second test case, rectangular parallelepiped (1,6,1)(1,6,1) can be divided into rectangular parallelepipeds with sizes (1,1,1)(1,1,1), (1,1,2)(1,1,2), (1,1,3)(1,1,3) and (1,1,6)(1,1,6).
In the third test case, rectangular parallelepiped (2,2,2)(2,2,2) can be divided into rectangular parallelepipeds with sizes (1,1,1)(1,1,1), (1,1,2)(1,1,2), (1,2,2)(1,2,2) and (2,2,2)(2,2,2).
这题目其实求的就是a的因子乘b的因子乘c的因子
所以重点是算出a,b,c的因子
但是中间会出现重复的情况,比如(1,1,2),(1,2,1)是同一种情况
所以我们还要用容斥原理去掉这种情况
情况分为四种:a,b重负的情况;a,c重复的情况;b,c重复的情况;a,b,c重复的情况
#include