坠痛苦的是,POJ 的辣鸡 G++ 编译器不支持 long long
,害得我调试调了半天……
Description
For every pair of triplets, $T_a = (I_a, J_a, K_a)$ and $T_b = (I_b, J_b, K_b)$, we define the difference value between $T_a$ and $T_b$ as follows:
$$ D(T_a, T_b) = \max (I_a − I_b, J_a − J_b, K_a − K_b) − \min (I_a − I_b, J_a − J_b, K_a − K_b) $$
Now you are given $N$ triplets, could you write a program to calculate the sum of the difference values between every unordered pair of triplets?