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

time limit?

Posted by 870817 at 2005-12-11 01:03:51 on Problem 1061
#include <stdio.h>
#include <math.h>
void main(){
	int m,n,x,y,l,i;
	scanf("%d %d %d %d %d",&x,&y,&m,&n,&l);
	if(m!=n){
        for(i=1;;i++){
		    if(((x+m*i)-(y+n*i))%l==0)
		        break;
		}
	    printf("%d\n",i);
	}
	else
		printf("Impossible\n");
}

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