Photo for the website
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Petryk is exploring web design and needs to resize a photograph to fit within a frame. The frames available are of sizes and . Your task is to determine the new dimensions of a photograph originally sized so that it fits perfectly into one of these frames while maintaining its original proportions. The photograph can be either enlarged or reduced.
Input
You are given four integers: , , , and , which represent the dimensions of the photograph and the frame, respectively. Each of these values is no greater than .
Output
Output two numbers representing the maximum possible dimensions of the photograph, rounded to three decimal places.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 14%