Tuesday, May 3, 2011

10790 - How Many Points of Intersection?


#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    unsigned long int a,b,k=0,c;
    //freopen("in.txt","r",stdin);
    while(scanf("%ld%ld",&a,&b)==2)
    {
        if(!a&&!b)break;
        k++;
        c=(a*(a-1)/2)*(b*(b-1)/2);
        cout<<"Case "<<k<<": "<<c<<endl;
    }
    exit(0);
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.