Chef has been working in a restaurant which has  N  floors. He wants to minimize the time it takes him to go from the N-th floor to ground floor. He can either take the elevator or the stairs. 
The stairs are at an angle of 45 degrees and Chef's velocity is V1 m/s when taking the stairs down. The elevator on the other hand moves with a velocity V2 m/s. Whenever an elevator is called, it always starts from ground floor and goes to N-th floor where it collects Chef (collecting takes no time), it then makes its way down to the ground floor with Chef in it.  

The elevator cross a total distance equal to N meters when going from N-th floor to ground floor or vice versa, while the length of the stairs is sqrt(2) * N because the stairs is at angle 45 degrees.

Chef has enlisted your help to decide whether he should use stairs or the elevator to minimize his travel time. Can you help him out?

-----Input-----
The first line contains a single integer T, the number of test cases. Each test case is described by a single line containing three space-separated integers N, V1, V2. 

-----Output-----
For each test case, output a single line with string Elevator or Stairs, denoting the answer to the problem.

-----Constraints-----
- 1 ≤ T ≤  1000 
- 1 ≤ N, V1, V2 ≤  100 

-----Example-----
Input:
3
5 10 15
2 10 14
7 14 10

Output:
Elevator
Stairs
Stairs

Difficulty: EASY
Tags: Mathematics

Starter code:

Solutions:
import math
for t in range(int(input())):
	(n, v1, v2) = map(int, input().split())
	t2 = 2 * n / v2
	t1 = math.sqrt(2) * n / v1
	if t1 <= t2:
		print('Stairs')
	else:
		print('Elevator')


import math
for i in range(int(input())):
	(n, v1, v2) = list(map(int, input().split()))
	t = math.sqrt(2) * n / v1
	e = 2 * n / v2
	if e < t:
		print('Elevator')
	else:
		print('Stairs')


no_of_cases = int(input())
for i in range(no_of_cases):
	(N, V1, V2) = map(float, input().split())
	t1 = (N + N) / V2
	t2 = N * 2 ** 0.5 / V1
	if t1 >= t2:
		print('Stairs')
	else:
		print('Elevator')


for i in range(int(input())):
	(n, v1, v2) = map(int, input().split())
	s = n * 1.4142135623730951 / v1
	e = (n + n) / v2
	if s < e:
		print('Stairs')
	else:
		print('Elevator')


import math
for _ in range(int(input())):
	(n, v1, v2) = map(int, input().split())
	v2 = n * 2 / v2
	v1 = n * 2 ** 0.5 / v1
	if v1 < v2:
		print('Stairs')
	else:
		print('Elevator')


import math
T = int(input())
for i in range(T):
	data = input().split(' ')
	elev = int(data[0])
	str = math.sqrt(2) * int(data[0])
	if str * int(data[1]) > elev * int(data[2]):
		print('Stairs')
	else:
		print('Elevator')


for i in range(int(input())):
	(n, v1, v2) = map(int, input().split())
	if n * 2 ** 0.5 / v1 < 2 * n / v2:
		print('Stairs')
	else:
		print('Elevator')


for i in range(int(input())):
	(n, v1, v2) = map(int, input().split())
	elevator = 2 * n / v2
	stairs = n * 2 ** (1 / 2) / v1
	if stairs > elevator:
		print('Elevator')
	else:
		print('Stairs')


import math
t = int(input())
for i in range(0, t):
	(n, v1, v2) = input().split()
	n = int(n)
	v1 = int(v1)
	v2 = int(v2)
	time1 = n / v2 * 2
	time2 = math.sqrt(2) * n / v1
	if time1 <= time2:
		print('Elevator')
	else:
		print('Stairs')


import math
for i in range(int(input())):
	(N, V1, V2) = map(int, input().split())
	a = N * math.sqrt(2) / V1
	b = 2 * N / V2
	if a < b:
		print('Stairs')
	else:
		print('Elevator')


for cases in range(int(input())):
	(floor, stairs_velocity, elevator_velocity) = map(int, input().split())
	stairs_time = floor * 2 ** 0.5 / stairs_velocity
	elevator_time = floor / elevator_velocity * 2
	if stairs_time > elevator_time:
		print('Elevator')
	else:
		print('Stairs')


import numpy as np
t = int(input())
ans = []
for i in range(t):
	(n, v1, v2) = [int(x) for x in input().split()]
	tc = np.sqrt(2) * n * 1000 / v1
	te = 2 * n * 1000 / v2
	if tc > te:
		ans.append('Elevator')
	elif tc < te:
		ans.append('Stairs')
for i in range(t):
	print(ans[i])


for t in range(int(input())):
	(floors, chef_velocity, elevator) = map(int, input().split())
	s = floors * 2 ** 0.5 / chef_velocity
	e = (floors + floors) / elevator
	if s < e:
		print('Stairs')
		pass
	else:
		print('Elevator')
		pass
	pass


import math
for i in range(int(input())):
	(n, v1, v2) = list(map(int, input().split()))
	time_stairs = math.sqrt(2) * n / v1
	time_elevator = 2 * n / v2
	if time_elevator < time_stairs:
		print('Elevator')
	else:
		print('Stairs')


import math
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	e = n * 2 / b
	x = math.sqrt(2)
	s = x * n / a
	if e < s:
		print('Elevator')
	else:
		print('Stairs')


t = int(input())
for i in range(t):
	nums = [int(x) for x in input().strip().split(' ')]
	stairs = 2 ** 0.5 * nums[0] / nums[1]
	elevator = 2 * nums[0] / nums[2]
	if stairs <= elevator:
		print('Stairs')
	else:
		print('Elevator')


T = int(input())
for i in range(T):
	(n, v1, v2) = list(map(int, input().split()))
	a = (n + n) / v2
	b = n * 2 ** 0.5 / v1
	if a > b:
		print('Stairs')
	else:
		print('Elevator')


d = 2 ** 0.5
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	e = 2 * a / c
	s = d * a / b
	if e < s:
		print('Elevator')
	else:
		print('Stairs')


import math

def time_elevator(n, v2):
	return 2 * n / v2

def time_stairs(n, v1):
	return math.sqrt(2) * n / v1
t = int(input())
for i in range(t):
	(n, v1, v2) = map(int, input().split())
	time_e = time_elevator(n, v2)
	time_s = time_stairs(n, v1)
	if time_e <= time_s:
		print('Elevator')
	else:
		print('Stairs')


for i in range(int(input())):
	(n, v1, v2) = map(int, input().split())
	ds = 2 ** (1 / 2) * n
	ts = ds / v1
	de = n + n
	te = de / v2
	if te < ts:
		print('Elevator')
	else:
		print('Stairs')


for i in range(int(input())):
	L = list(map(int, input().split()))
	if 2 ** 0.5 * L[0] / L[1] < 2 * (L[0] / L[2]):
		print('Stairs')
	else:
		print('Elevator')


import math as m
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	d1 = a * m.sqrt(2)
	d2 = 2 * a
	t1 = d1 / b
	t2 = d2 / c
	if t1 < t2:
		print('Stairs')
	else:
		print('Elevator')


import math
n = int(input())
for i in range(n):
	(a, v1, v2) = map(int, input().split(' '))
	b = a * math.sqrt(2) / v1
	c = a * 2 / v2
	if b < c:
		print('Stairs')
	else:
		print('Elevator')


q = int(input())
while q > 0:
	(n, v1, v2) = map(int, input().split())
	t1 = n * 1.414 / v1
	t2 = 2 * n / v2
	if t1 < t2:
		print('Stairs')
	else:
		print('Elevator')
	q = q - 1


n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	s = a * 2 ** 0.5 / b
	e = (a + a) / c
	if s < e:
		print('Stairs')
	else:
		print('Elevator')


import math
T = int(input())
for i in range(T):
	(n, v1, v2) = list(map(int, input().split()))
	x = v1 * math.sqrt(2) * n
	y = v2 * n
	if x < y:
		print('Elevator')
	else:
		print('Stairs')


import math
for i in range(int(input())):
	(n, s, e) = map(int, input().split())
	t1 = 2 * n / e
	t2 = n * math.sqrt(2) / s
	if t1 < t2:
		print('Elevator')
	else:
		print('Stairs')


try:
	from math import sqrt
	for _ in range(int(input())):
		(floor, vel1, vel2) = map(int, input().rstrip().split())
		if sqrt(2) * floor / vel1 < 2 * floor / vel2:
			print('Stairs')
		else:
			print('Elevator')
except:
	pass


import math
t = int(input())
for i in range(0, t):
	(n, v1, v2) = map(int, input().split())
	stair_time = math.sqrt(2) * n / v1
	ele_time = 2 * n / v2
	if stair_time < ele_time:
		print('Stairs')
	else:
		print('Elevator')


import math
t = int(input())
for i in range(t):
	(d, s, e) = map(int, input().split())
	ts = d * math.sqrt(2) / s
	te = 2 * d / e
	if ts < te:
		print('Stairs')
	else:
		print('Elevator')


import math
for i in range(int(input())):
	(n, v1, v2) = [int(n) for n in input().split()]
	t_el = 2 * n / v2
	t_st = n * math.sqrt(2) / v1
	print('Elevator' if t_el < t_st else 'Stairs')


t = int(input())
for i in range(t):
	(N, V1, V2) = map(int, input().split())
	stairlength = N * 2 ** 0.5
	stairtime = stairlength / V1
	elevatortime = N / V2 * 2
	if stairtime < elevatortime:
		print('Stairs')
	else:
		print('Elevator')


t = int(input())
for i in range(t):
	(n, v1, v2) = map(int, input().split())
	t1 = n * 1.414 / v1
	t2 = n * 2 / v2
	if t1 < t2:
		print('Stairs')
	else:
		print('Elevator')


import math
p = int(input())
for j in range(p):
	(n, a1, a2) = map(int, input().split(' '))
	stair = n * math.sqrt(2) / a1
	elevator = 2 * n / a2
	if stair < elevator:
		print('Stairs')
	else:
		print('Elevator')


t = int(input())
for i in range(t):
	(n, V1, V2) = map(int, input().split())
	a = (n + n) / V2
	b = n * 2 ** 0.5 / V1
	if a < b:
		print('Elevator')
	else:
		print('Stairs')


import math
for _ in range(int(input())):
	a = list(map(int, input().split()))
	steps = a[0]
	stairs_speed = a[1]
	elevators_speed = a[2]
	stairs_distance = math.sqrt(2) * steps
	elevators_distance = steps + steps
	stairs_time = stairs_distance / stairs_speed
	elevators_time = elevators_distance / elevators_speed
	if stairs_time < elevators_time:
		print('Stairs')
	else:
		print('Elevator')


import math
for _ in range(int(input())):
	(n, v1, v2) = map(int, input().split())
	elevator = 2 * n * v1
	stairs = n * v2 * math.sqrt(2)
	if elevator < stairs:
		print('Elevator')
	else:
		print('Stairs')


import math
num = int(input())
i = 0
while i < num:
	(N, v1, v2) = map(int, input('').split())
	d1 = N
	d2 = N * math.sqrt(2)
	t1 = N / v1
	t2 = d2 / v2
	if t1 > t2:
		print('Elevator')
	else:
		print('Stairs')
	i = i + 1


import math
try:
	t = int(input())
	for i in range(t):
		x = list(map(int, input().split()))
		y = x[2] / (math.sqrt(2) * x[1])
		if y > 1:
			print('Elevator')
		else:
			print('Stairs')
except:
	pass


import math
t = int(input())
for i in range(t):
	(N, V1, V2) = map(int, input().split())
	sts = math.sqrt(2) * N / V1
	elv = 2 * N / V2
	if sts > elv:
		print('Elevator')
	else:
		print('Stairs')


for _ in range(int(input())):
	(x, y, z) = map(int, input().split())
	elevator = x * 2 / z
	stairs = x * 1.414 / y
	if stairs > elevator:
		print('Elevator')
	else:
		print('Stairs')


import math
t = int(input())
for i in range(t):
	(N, V1, V2) = map(int, input().split())
	t1 = math.sqrt(2) * N / V1
	t2 = 2 * N / V2
	if t1 < t2:
		print('Stairs')
	else:
		print('Elevator')


t = int(input())
for i in range(t):
	(n, v1, v2) = map(float, input().split())
	a = (n + n) / v2
	b = n * 2 ** 0.5 / v1
	if a > b:
		print('Stairs')
	else:
		print('Elevator')


import math
T = int(input())
for i in range(0, T):
	(N, V1, V2) = map(int, input().split())
	S = math.sqrt(2)
	if N / V2 * 2 < N * S / V1:
		print('Elevator')
	else:
		print('Stairs')


n = int(input())
for x in range(n):
	(a, b, c) = map(int, input().split())
	if a * b * 2 < c * a * 2 ** (1 / 2):
		print('Elevator')
	else:
		print('Stairs')


n = int(input())
l = []
for i in range(0, n):
	(a, b, c) = list(map(int, input().split()))
	n1 = 2 ** 0.5 * (a / b)
	n2 = 2 * (a / c)
	if n1 > n2:
		l.append('Elevator')
	else:
		l.append('Stairs')
for i in l:
	print(i)


import math
for _ in range(int(input())):
	(n, v1, v2) = map(int, input().split())
	x = 2 * n / v2
	y = math.sqrt(2) * n / v1
	if x > y:
		print('Stairs')
	else:
		print('Elevator')


for _ in range(int(input())):
	(n, v1, v2) = list(map(int, input().split()))
	t1 = n / v1
	t2 = 2 ** 0.5 * n / v2
	if t1 > t2:
		print('Elevator')
	else:
		print('Stairs')


for _ in range(int(input())):
	arr1 = [int(x) for x in input().split()]
	n = arr1[0]
	ele_v = arr1[2]
	str_v = arr1[1]
	ele_d = n * 2
	str_d = n * 2 ** (1 / 2)
	if ele_d / ele_v > str_d / str_v:
		print('Stairs')
	else:
		print('Elevator')


import math
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	p = a * math.sqrt(2) / b
	q = 2 * a / c
	if p < q:
		print('Stairs')
	else:
		print('Elevator')


import math
for _ in range(int(input())):
	(n, v, V) = map(int, input().split())
	if n * v * math.sqrt(2) > n * V:
		print('Stairs')
	else:
		print('Elevator')


n = int(input())
from math import sqrt
for i in range(n):
	(N, V1, V2) = map(int, input().split())
	print('Elevator' if 2 * N / V2 < N * sqrt(2) / V1 else 'Stairs')


import math
t = int(input())
for i in range(t):
	(n, v1, v2) = map(int, input().split(' '))
	stair = n * math.sqrt(2) / v1
	elevator = 2 * n / v2
	if stair < elevator:
		print('Stairs')
	else:
		print('Elevator')


t = int(input())
for i in range(t):
	(n, v1, v2) = map(int, input().split())
	x1 = 2 * n / v2
	x2 = n * 1.41421 / v1
	if x1 > x2:
		print('Stairs')
	elif x1 < x2:
		print('Elevator')


for _ in range(int(input())):
	(n, v1, v2) = map(int, input().split())
	s = n * 2 ** 0.5 / v1
	e = (n + n) / v2
	if s < e:
		print('Stairs')
	else:
		print('Elevator')


from math import sqrt
for _ in range(int(input())):
	(n, v1, v2) = list(map(int, input().split()))
	t1 = n / v1
	t2 = n * sqrt(2) / v2
	if t1 < t2:
		print('Stairs')
	else:
		print('Elevator')


k = int(input())
for i in range(1, k + 1):
	(n, v1, v2) = map(int, input().split())
	if 2 * n / v2 < n * 1.414 / v1:
		print('Elevator')
	else:
		print('Stairs')


import math
for _ in range(int(input())):
	(n, v1, v2) = map(int, input().split())
	s = n * math.sqrt(2) / v1
	e = 2 * n / v2
	if s < e:
		print('Stairs')
	else:
		print('Elevator')


T = int(eval(input('')))
for i in range(T):
	(n, v1, v2) = list(map(int, input('').split(' ')))
	t1 = 2 ** 0.5 * n / v1
	t2 = 2 * n / v2
	if t1 > t2:
		print('Elevator')
	else:
		print('Stairs')


import math
for _ in range(int(input())):
	(N, V1, V2) = map(int, input().split())
	elevator_dist = N * 2
	stairs_dist = N * math.sqrt(2)
	elev_time = elevator_dist / V2
	stairs_time = stairs_dist / V1
	if elev_time > stairs_time:
		print('Stairs')
	else:
		print('Elevator')


import math
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	elevator_time = a * 2 / c
	stair_time = a * math.sqrt(2) / b
	if elevator_time < stair_time:
		print('Elevator')
	else:
		print('Stairs')