| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
不知道为什么,总是WA,各路高手帮忙看看吧!谢谢了啊!#include<stdio.h>
void main(){
int x,y,m,n,l,a,b,c,i,p,nl,ii;
scanf("%d",&p);
for(ii=1;ii<=p;ii++){
scanf("%d%d%d%d%d",&x,&y,&m,&n,&l);
a=x+y;
b=m+n;
c=a%b;
if(x==y||x>2000000000||y>2000000000||l>2100000000||m>2000000000||n>2000000000)
return;
if(a%b==0){
nl=a/b;
printf("%d\n",nl);
}
else{
for(i=2;c!=0&&i<100;i++){
a+=l;
c=a%b;
nl=a/b;
}
if(c==0)printf("%d\n",nl);
else
printf("Imposible\n");
}
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator