#abc340f. F - S = 1

F - S = 1

Score: 525525 points

问题描述

给定整数 XXYY,满足至少一个条件 X0X \neq 0Y0Y \neq 0

寻找一对整数 (A,B)(A, B),满足以下所有条件。如果不存在这样的整数对,请报告。

  • 1018A,B1018-10^{18} \leq A, B \leq 10^{18}
  • xyxy 平面上以点 (0,0),(X,Y),(A,B)(0, 0), (X, Y), (A, B) 为顶点的三角形面积为 11

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given integers XX and YY, which satisfy at least one of X0X \neq 0 and Y0Y \neq 0.
Find a pair of integers (A,B)(A, B) that satisfies all of the following conditions. If no such pair exists, report so.

  • 1018A,B1018-10^{18} \leq A, B \leq 10^{18}
  • The area of the triangle with vertices at points (0,0),(X,Y),(A,B)(0, 0), (X, Y), (A, B) on the xyxy-plane is 11.

Constraints

  • 1017X,Y1017-10^{17} \leq X, Y \leq 10^{17}
  • (X,Y)(0,0)(X, Y) \neq (0, 0)
  • XX and YY are integers.

Input

The input is given from Standard Input in the following format:

XX YY

Output

If there is a pair of integers (A,B)(A, B) that satisfies the conditions, print it in the following format:

AA BB

Otherwise, print -1.

Sample Input 1

3 5

Sample Output 1

1 1

The area of the triangle with vertices at points (0,0),(3,5),(1,1)(0, 0), (3, 5), (1, 1) is 11. Thus, (A,B)=(1,1)(A, B) = (1, 1) satisfies the conditions.

Sample Input 2

-2 0

Sample Output 2

0 1

Sample Input 3

8752654402832944 -6857065241301125

Sample Output 3

-1

update @ 2024/3/10 01:33:24