ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1114. Boxes

why wa#7, i think everything is right
Posted by hhh 12 Mar 2009 01:23
#include <iostream>
using namespace std;
int main()
{ unsigned __int64 n,a,b,i,t=1,r=1,u=1,h=1,p=1,x,y;
cin>>n>>a>>b;
if((a==0)&&(b==0)) { cout<<1; return 0; }

if(a>b) { x=a; y=b; }
else { x=b; y=a; }

if(y==0) { for(i=n+1; i<=n+x; i++) r*=i;
for(i=2; i<=x; i++) t*=i; r/=t;
cout<<r; return 0; }

for(i=2; i<=y; i++) p*=i;
for(i=y+1; i<=x; i++) h*=i; h*=p;
for(i=n+1; i<=n+y; i++) t*=i;
for(i=n+y+1; i<=n+x; i++) u*=i; u*=t;
r=u*t/(h*p);
cout<<r;
return 0; }