测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A7799. Line

编程题 普及/提高-

题目描述

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

说明/提示

输入数据保证$A^2 + B^2 > 0$。

**请注意,本题的空间限制为256MB,是默认空间限制的两倍**
上一题 去做题 下一题