Read problem statements in [Bengali], [Mandarin Chinese], [Russian], and [Vietnamese] as well.

In Chefland, the speed of light is $c\ \mathrm{m}/\mathrm{s}$, and acceleration due to gravity is $g\ \mathrm{m}/\mathrm{s}^2$. 

Find the smallest height (in meters) from which Chef should jump such that during his journey down only under the effect of gravity and independent of any air resistance, he achieves the speed of light and verifies Einstein's theory of special relativity.

Assume he jumps at zero velocity and at any time, his velocity ($v$) and depth of descent ($H$) are related as
$$v^{2} = 2 \cdot g \cdot H.$$

------  Input ------

The first line contains an integer $T$, the number of test cases. Then the test cases follow.
Each test case contains a single line of input, two integers $g$, $c$.

------  Output ------
For each test case, output in a single line the answer to the problem. We can show that under the constraints, the answer is an integer.

----- Sample Input 1 ------ 
3
7 1400
5 1000
10 1000
----- Sample Output 1 ------ 
140000
100000
50000
----- explanation 1 ------ 
Test Case $1$: For Chef to achieve the speed of light, the minimum height required is $\frac{c^{2}}{2 \cdot g}$ = $\frac{1400 \cdot 1400}{14}$ = $140000$ meters.

Test Case $3$: For Chef to achieve the speed of light, the minimum height required is $\frac{c^{2}}{2 \cdot g}$ = $\frac{1000 \cdot 1000}{20}$ = $50000$ meters.

Difficulty: EASY
Tags: Mathematics

Complete search
Skill types: Complete search

Starter code:

Solutions:
n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	print(b * b // (2 * a))


for i in range(int(input())):
	(g, c) = map(int, input().split())
	r = c * c
	r1 = 2 * g
	print(r // r1)


T = int(input(''))

def dist():
	(g, c) = map(int, input().split())
	H = c ** 2 / (2 * g)
	return H
while T > 0:
	print(int(dist()))
	T = T - 1


t = int(input())
for _ in range(t):
	if t >= 1 and t <= 5 * pow(10, 3):
		(g, c) = map(int, input().split())
		if g >= 1 and g <= 10 and (c >= 1) and (c <= 3000):
			x = pow(c, 2) / (2 * g)
			print(int(x))


n = int(input())
for i in range(n):
	(g, c) = list(map(int, input().split()))
	print(c ** 2 // (2 * g))


t = int(input())
for i in range(t):
	(g, c) = map(int, input().split())
	print(c * c // (g * 2))


n = int(input())
a = []
b = []
for i in range(n):
	(x, z) = map(int, input().split())
	a.append(x)
	b.append(z)
for (a, b) in zip(a, b):
	print(int(b * b / (2 * a)))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(int(b * b / (2 * a)))


import math
T = int(input())
for _ in range(T):
	(g, c) = map(int, input().split())
	height = c ** 2 / (2 * g)
	print(int(height))


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	print(y ** 2 // (2 * x))


T = int(input())
for i in range(T):
	(g, c) = map(int, input().split())
	height = c * c // (2 * g)
	print(height)


t = int(input())
for i in range(0, t):
	(g, c) = map(int, input().split())
	ans = c * c
	ans1 = ans // (2 * g)
	print(ans1)


def code():
	cases = int(input())
	for _ in range(cases):
		(g, c) = map(int, input().split(' '))
		H = c ** 2 // (2 * g)
		print(H)
code()


import sys
t = int(input())
while t != 0:
	(x, y) = list(map(int, sys.stdin.readline().split()))
	z = y * y // (2 * x)
	print(z)
	t -= 1


T = int(input())
for i in range(T):
	(g, c) = map(int, input().split())
	n = c * c
	n2 = 2 * g
	print(int(n / n2))


T = int(input())
for _ in range(T):
	(g, c) = map(int, input().split())
	print(c ** 2 // (2 * g))


t = int(input())
for i in range(0, t):
	(v, g) = map(int, input().split(' '))
	print(g ** 2 // (2 * v))


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	c = b * b
	d = 2 * a
	e = c // d
	print(e)


try:
	t = int(input())
	for r in range(t):
		(g, c) = map(int, input().split())
		a = c ** 2
		b = 2 * g
		print(a // b)
except:
	pass


for _ in range(int(input())):
	(g, c) = map(int, input().split())
	a = c * c
	b = 2 * g
	d = a // b
	print(d)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	x = b * b
	y = a * 2
	z = x // y
	print(z)


n = int(input())
for _ in range(n):
	(a, b) = map(int, input().split())
	h = b * b
	k = 2 * a
	p = h // k
	print(p)