题库练习 Line
← 上一题 下一题 →

A7799 | Line

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

A line on the plane is described by an equation $Ax+By+C=0$ . You are to find any point on this line, whose coordinates are integer numbers from $-5·10^{18}$ to $5·10^{18}$ inclusive, or to find out that such points do not exist.

**题目描述**

一条在平面上的线可以被表示为$Ax+By+C=0$。你的任务是找到这条线上的任意一点,保证该点的横纵坐标数值均在$-5*10^{18}$至$5*10^{18}$之间。如果这样的点不存在,输出-1。

感谢[Macw](https://www.acgo.cn/person/929871)提供翻译

输入格式

The first line contains three integers $A$ , $B$ and $C$ ( $-2·10^{9}<=A,B,C<=2·10^{9}$ ) — corresponding coefficients of the line equation. It is guaranteed that $A^{2}+B^{2}>0$ .

输入包含三个整数,$A, B, C$。表示一条直线。

输出格式

If the required point exists, output its coordinates, otherwise output -1.

输出包含两个整数,表示任意一个符合要求的点的坐标。如果这样的点不存在,输出-1。

输入输出样例

输入 #1
2 5 3
输出 #1
6 -3
C++ 编辑器
输入
输出