No tags yet

No tag edit access

106. The equation time limit per test: 0.25 sec.
There is an equation ax + by + c = 0. Given a,b,c,x1,x2,y1,y2 you must determine, how many integer roots of this equation are satisfy to the following conditions : x1<=x<=x2, y1<=y<=y2. Integer root of this equation is a pair of integer numbers (x,y).
Input Input contains integer numbers a,b,c,x1,x2,y1,y2 delimited by spaces and line breaks. All numbers are not greater than 10
Output Write answer to the output.
Sample Input 1 1 -3 0 4 0 4
Sample Output 4 |

Codeforces (c) Copyright 2010-2019 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/20/2019 10:59:47 (e2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|