Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Create quiz
  • Loading branch information
dgupta777 authored Oct 27, 2017
commit 238a4af06fe7c78904aea4ccf9265b35fa5c927d
34 changes: 34 additions & 0 deletions bin/Lost Robot/quiz
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

Robot Bunny is lost. It wants to reach its home as soon as possible. Currently it is standing at coordinates (x1, y1) in 2-D plane.
Its home is at coordinates (x2, y2). Bunny is extremely worried. Please help it by giving a command by telling the direction in which it
should to go so as to reach its home. If you give it a direction, it will keep moving in that direction till it reaches its home.
There are four possible directions you can give as command - "left", "right", "up", "down". It might be possible that you can't instruct
the robot in such a way that it reaches its home. In that case, output "sad".

Input
First line of the input contains an integer T denoting the number of test cases. T test cases follow.

First line of each test case contains four space separated integers x1, y1, x2, y2.

Output
For each test case, output a single line containing "left" or "right" or "up" or "down" or "sad" (without quotes).

Constraints
1 ≤ T ≤ 5000
0 ≤ x1, y1, x2, y2. ≤ 100
It's guaranteed that the initial position of robot is not his home.
Example

Input
3
0 0 1 0
0 0 0 1
0 0 1 1

Output:
right
up
sad

Explanation
Test case 1. If you give Bunny the command to move to the right, it will reach its home.