8 UVA 10790 How Many Points of Intersection?

前端之家收集整理的这篇文章主要介绍了8 UVA 10790 How Many Points of Intersection?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

第1排第i个点和第2排第j个点相连,在这条线段上会产生(a-i)*(j⑴)个交点,

以此类推,推公式便可。


#include<cstdio> #define ll long long ll a,b; int cas=1; int main() { while(~scanf("%d%d",&a,&b)&&(a||b)) printf("Case %d: %lld ",cas++,a*(a⑴)/2*b*(b⑴)/2); return 0; }


猜你在找的PHP相关文章