No.2776 Bigger image
タグ : / 解いたユーザー数 128
作問者 :
amentorimaru
Story
Now that Yu-san's room has safely been cleaned up, Yu-san is planning to invite a friend over to hang out.
Before that, however, Yu-san wants to show off by sending the friend a photo of the room.
Yu-san is going to take a photo with a camera, transfer it to a computer, and send it to the friend.
Then, a question suddenly came to Yu-san's mind.
"Given an image, which makes it bigger: keeping its orientation as it is, or turning it by $90^\circ$?"
Let's settle Yu-san's question.
Problem Statement
You want to display a rectangular image of height $A$ and width $B$ on a screen of height $H$ and width $W$.
There are the following $2$ ways to display the image on the screen.
- Without changing the orientation of the image, display the smaller of the following two images: the image appropriately enlarged/reduced so that its width equals $W$, and the image appropriately enlarged/reduced so that its height equals $H$.
- Rotate the image $90^\circ$ clockwise, and display the smaller of the following two images: the image appropriately enlarged/reduced so that the width of the rotated image equals $W$, and the image appropriately enlarged/reduced so that the height of the rotated image equals $H$.
Find the display method that can display the image larger.
Here, "displaying the image larger" means displaying an image with a larger area than the other display method does.
Input
$A\ B$ $H\ W$
Constraints
- $1\leq A,B,H,W\leq 10,000$
- All inputs are integers.
Output
Print Non-rotating if the display method that does not change the orientation of the image can display it larger,
print Rotating if the display method that rotates the image by $90^\circ$ can display it larger,
and print Same if the size of the displayed image is the same under both display methods.
Print a newline at the end.
Sample
Sample 1
Input
3 6 6 12
Output
Non-rotating
With the display method that does not change the orientation of the image, the image is enlarged and its area is $72$.
With the display method that rotates the image by $90^\circ$, the image is neither enlarged nor reduced and its area is $18$.
Therefore, the display method that does not change the orientation of the image can display it larger.
Sample 2
Input
4 12 36 6
Output
Rotating
With the display method that does not change the orientation of the image, the area is $12$.
With the display method that rotates the image by $90^\circ$, the area is $108$.
Therefore, the display method that rotates the image by $90^\circ$ can display it larger.
Sample 3
Input
1 1 141 173
Output
Same
The area of the displayed image is the same under both display methods.
Sample 4
Input
2334 9149 9138 469
Output
Rotating
Note that the area of the displayed image is not necessarily an integer.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。