The Commuting God

Interview

Time limit1sMemory limit256 MB

Summary
Given integers A and B where x^2 + 2Ax + B = 0 has integer roots, print the distinct roots in ascending order.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Taehyun commutes to Hanyang University every day. It takes him about 1 hour and 40 minutes to leave home and arrive at the building. This is his third year commuting. Today he left 1 hour and 40 minutes early to get to school, but the train was delayed and he has not even reached Wangsimni yet. Commuting has always been miserable for him, but today he is furious. Four hours wasted on the street every day. Is he supposed to accept this? He uses up all his energy just getting to school, so he has none left to sit through class.

Why is the train delayed every single time, and why is the subway so packed? On every morning commute, Taehyun feels like he has never been so close to another person in his life. If only they would add a few more trains, his commute would be a little easier. But there was not much a worn-out Taehyun could do.

Fed up, Taehyun decided to start a commuting club. It is a club where members meet every day to talk about how hard commuting is and comfort each other. The club became a great source of strength for Taehyun, and on every difficult commute they encouraged each other and became one.

The Commuting God took pity on the members of the commuting club and, in his mercy, decided to grant one member the ability to teleport when going to and from school, freeing that person from the pain of commuting. He intends to bestow this fortune on the members who pass a test he made.

In truth, he did not make the test. The Commuting God has recently been working through a workbook, and he is hopeless at math, so he is struggling. He wants to find the roots of a simple quadratic equation, but he cannot solve it, so he is making people solve problems for him instead of doing his workbook, hoping to be praised by his workbook teacher.

Taehyun is the president of the commuting club, but he wants to use this incredible fortune to leave the club. Let us help Taehyun!

Input

The two coefficients AA and BB of x2+2Ax+B=0x^2 + 2Ax + B = 0 are given. AA and BB are integers, and the roots of this equation are always integers. (−1000≤A,B≤1000-1000 \le A, B \le 1000)

Output

On the first line, print all roots of the equation separated by spaces in ascending order. If there is a repeated root, print only one.

Examples3

  1. Example 1

    Input
    2 3
    
    Expected output
    -3 -1
    
  2. Example 2

    Input
    1 -8
    
    Expected output
    -4 2
    
  3. Example 3

    Input
    1 1
    
    Expected output
    -1