Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

National Flag

By amirul_islam · Limits 1s, 512 MB

Today is the 16th December, a red letter day of our national history. The whole country equipped with red-green flags. Unlike every year, Afia can't go out to celebrate the day in this year, because she has an important exam 'Computer Interfacing' in the next day. But, she really wants to do at least something to make the day special. She has a large piece of green cloth and also a piece of red cloth. She wants to make a large national flag to fly it on the house roof. Before this, she may need to cut the cloth to give it our national flag shape. We know, our national flag is bottle green in color and rectangular in size in the proportion of 10:6, with a red circle in the middle. (Fig: A, B)
Suppose, Afia has a rectangular piece of green cloth which length is xx meters and width is yy meters. She is agreed to cut exactly dd meters (possibly zero) from length and same dd meters from width of the rectangular piece so that remaining part maintain the correct ratio of our national flag (10:6). (see Fig: C for more details) She is not yet concern about the red circle in the middle. As she is busy with her study for exam, your task is to help her to determine the new generated xx' and yy' after cutting d meters from both side. Remember, she always wants to get largest possible flag and you have a normal scale by which you can calculate only the integer value (in meters), not fractional value. Print “Not possible”, if it is not possible to obtain the ratio of our national flag that already mentioned above.

Input

Input contains two space separated integers xx and yy (1x,y10151 \le x, y \le 10^{15}) as described above.

Output

If it is possible to obtain the ratio x:y=10:6x':y' = 10: 6, print xx' and yy' (separated by a space), as described above. Print "Not possible" (without quotes) otherwise.

Sample

InputOutput
12 10
5 3

Discussion

Statistics


60% Solution Ratio

Mr_BangladeshEarliest, Dec '19

Mr_BangladeshFastest, 0.0s

ramisa.alamLightest, 0 B

CodingmasterShortest, 112B

Submit

Login to submit

Related Contests

Toph uses cookies. By continuing you agree to our Cookie Policy.