14760 - Check if line passes through point (3,18)   

Description

(20 points)

You are given four positive integers a, b, c, d, which represent two distinct points (a, b) and (c, d).

Determine whether the line connecting (a, b) and (c, d) passes through the point (3, 18).

If it does, output 1; otherwise, output 0.

(Hint: Translate(平移) the coordinates so that (3, 18) becomes the origin, then check collinearity.

This can be implemented by verifying whether both points satisfy the same line equation of the form y = ax + b.)

Input

Input four integers: a, b, c, d.

Output

One integer:

1 if the line passes through (3,18), otherwise 0.

Ensure that the output, including formatting 輸出格式, exactly matches the provided samples.

Sample Input  Download

Sample Output  Download

Tags




Discuss