0
点赞
收藏
分享

微信扫一扫

翻译题寒假第一次周赛7

西特张 2022-01-24 阅读 51
p2plinqc#

Monitor【显示器】

time limit per test

0.5 second

memory limit per test

64 megabytes

Reca company makes monitors, the most popular of their models is AB999 with the screen size a × b centimeters. Because of some production peculiarities a screen parameters are integer numbers. Recently the screen sides ratio x: y became popular with users. That's why the company wants to reduce monitor AB999 size so that its screen sides ratio becomes x: y, at the same time they want its total area to be maximal of all possible variants. Your task is to find the screen parameters of the reduced size model, or find out that such a reduction can't be performed.

【Reca公司生产显示器,他们最受欢迎的模型是尺寸a*bcm的AB999。因为产品特点,一块屏幕的尺寸大小参数是整数。最近,屏幕边长比例x:y已成为用户最欢迎的。这就是公司想要削减显示器AB999尺寸以便它的屏幕边长比例变为x:y,与此同时他们想要它的总面积能是最全面的所有可能的种类。你的任务是找到削减之后模型的屏幕种类,或者找出那个缩图不能执行】

Input

The first line of the input contains 4 integers — abx and y (1 ≤ a, b, x, y ≤ 2·109).

【第一行输入包含4个整数---a,b,x和y(1 ≤ a, b, x, y ≤ 2·109)。】

Output

If the answer exists, output 2 positive integers — screen parameters of the reduced size model. Output 0 0 otherwise.

如果答案存在输出2个正整数---缩图模型屏幕参数,否则输出0 0.

Examples

input

Copy

800 600 4 3

output

Copy

800 600

input

Copy

1920 1200 16 9

output

Copy

1920 1080

input

Copy

1 1 1 2

output

Copy

0 0
举报

相关推荐

0 条评论