問題一覧 > 通常問題

No.2776 Bigger image

レベル : / AI推定難易度 : 189 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 128
作問者 : yuusaan / テスター : 👑 seekworser 👑 amentorimaru
お気に入りにしたユーザー ProblemId : 10533 / 自分の提出
問題文最終更新日: 2024-06-01 08:07:07
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 432 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。