Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

求测试数据

Posted by Dream0801 at 2006-09-14 16:49:05 on Problem 1061
#include<stdio.h>
#include<math.h>
int main()
{ long int x,y,m,n,l,a,b,i,j;
  scanf("%ld %ld %ld %ld %ld",&x,&y,&m,&n,&l);
if((x!=y)&&(x<2000000000)&&(y<2000000000)&&(m>0)&&(n>0)&&(m<2000000000)&&(n<2000000000)&&(l<2100000000)&&(l>0)&&(fabs(x)<l)&&(fabs(y)<l))
{
 if(x>y)
 { a=x;b=y;i=m;j=n;}
 else
 {a=y;b=x;i=n;j=m;}
 if(i>j)
 { if((l-(a-b))%(i-j)==0)
   printf("%d\n",(l-(a-b))/(i-j));
   else
   printf("Impossible\n");}
 if(i==j)
 printf("Impossible\n");
 if(i<j)
 { if((a-b)%(j-i)==0)
   printf("%d\n",(a-b)/(j-i));
   else
   printf("Impossible\n");}
}
  return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator