Under construction

Still being built. Things may change

Rectangular polygon

Interview

Time limit2sMemory limit1024 MB

Summary
Given area S and perimeter P, find integer side lengths a and b (a >= b) of a rectangle with those values, or print -1 if none exist.
Level

Easy3 of 10

Topics
Math, Implementation
Solved
No attempts yet

Statement

Recently, to improve training for the armed forces of A-landia, it was decided to rebuild one of the abandoned military training grounds. Part of the design documents kept in the archives shows that the ground is rectangular. The experts worked out its area from the types of weapons tested there, and its perimeter from the amount of barbed wire used to fence it. The area is an integer number of square meters, and the perimeter is an integer number of meters.

Your task is to find the side lengths of the ground, given that each side is also an integer number of meters.

Input

The first line of the input file contains two integers SS and PP, the area in square meters and the perimeter in meters of the ground. 1≤S≤5⋅1081 \le S \le 5 \cdot 10^8, 1≤P≤600001 \le P \le 60000.

Output

If there exist integers aa and bb (a≥ba \ge b) such that a rectangle with sides aa and bb has area SS and perimeter PP, print these two numbers on the first line of the output file. Otherwise (if no rectangle with the given area and perimeter exists, or its sides are not integers), print a single number −1-1.

Examples3

  1. Example 1

    Input
    16 16
    
    Expected output
    4 4
    
  2. Example 2

    Input
    6 10
    
    Expected output
    3 2
    
  3. Example 3

    Input
    7 11
    
    Expected output
    -1