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 |
我哪里有错?帮帮我rogram qingwa2; Var x, y, l, m, n, i, ca: Longint; Begin Readln(x, y, m, n, l); ca := x - y; If (x <> y) And (m = n) Then Writeln('Impossible'); If m<n Then Begin i := 1; While (ca + i * l) Mod (n - m) <> 0 Do Begin i := i + 1; If i - 1 > n - m Then Begin Writeln('Impossible'); Exit; End; End; End Else Begin i := 1; While (ca + i * l) Mod (n - m) <> 0 Do Begin i := i - 1; If i + 1 < n - m Then Begin Writeln('Impossible'); Exit; End; End; End; Writeln(abs((ca + i * l) Div (m - n))); End. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator