UVA 10790 - How Many Points of Intersection?

上面给出a个点,下面给出b个点,上面的每一个点跟下面的给一个点都有连线,求连线的交点数。

#include<stdio.h>

long long a, b;

int main()
{
int cas = 0;
while( scanf( "%lld%lld", &a, &b), a && b)
{
printf( "Case %d: %lld\n", ++ cas, b*(b-1)*a*(a-1)/4);
}
return 0;
}

 

你可能感兴趣的:(intersect)