Given the maximum possible area of the right angle triangle for a fixed length of hypotenuse. The task is to find the length of hypotenuse.
Note: If the answer comes in Decimal, find it's Floor value.
Example 1:
Input:
N = 25
Output:
10
Explanation:
For a maximum area of 25 square Units
of a Right-angled Triangle,
the length of it's Hypotenuse is 10.
Example 2:
Input:
N = 21
Output:
9
Explanation:
For a maximum area of 21 square Units
of a Right-angled Triangle, the
length of it's Hypotenuse is 9.165 = 9.
Your Task:
You don't need to read input or print anything. Your task is to complete the function getHypotenuse() which takes an Integer N as input and returns the answer.
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)
Constraints:
1 <= N <= 10^{10}

Difficulty: EASY
Tags: Mathematics
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)

Starter code:
#User function Template for python3

class Solution:
    def getHypotenuse(self, N):
        # code here 

Solutions:
class Solution:

	def getHypotenuse(self, N):
		return int(2 * N ** 0.5)


class Solution:

	def getHypotenuse(self, N):
		return int(math.sqrt(4 * N))


from math import sqrt
from math import floor

class Solution:

	def getHypotenuse(self, N):
		return floor(sqrt(N * 4))


class Solution:

	def getHypotenuse(self, N):
		return int((N * 4) ** (1 / 2))


import math

class Solution:

	def getHypotenuse(self, N):
		return int(2 * math.sqrt(N))


class Solution:

	def getHypotenuse(self, N):
		return int((N * 4) ** 0.5)


import math

class Solution:

	def getHypotenuse(self, N):
		return math.floor(2 * math.sqrt(N))


import math

class Solution:

	def getHypotenuse(self, N):
		return int(math.sqrt(4 * N))
import math
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		N = int(input())
		ob = Solution()
		print(ob.getHypotenuse(N))


class Solution:

	def getHypotenuse(self, N):
		d = int(2 * N ** 0.5)
		return d
import math
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		N = int(input())
		ob = Solution()
		print(ob.getHypotenuse(N))


import math

class Solution:

	def getHypotenuse(self, N):
		area_square = 2 * N
		length_side = math.sqrt(area_square)
		length_hyp = math.sqrt(2 * pow(length_side, 2))
		return int(length_hyp)


class Solution:

	def getHypotenuse(self, N):
		Area = N
		return int(2 * math.sqrt(Area))


class Solution:

	def getHypotenuse(self, N):
		z = 2 * pow(N, 0.5)
		return int(z)


class Solution:

	def getHypotenuse(self, N):
		ans = int(math.sqrt(N) * 2)
		return ans


import math

class Solution:

	def getHypotenuse(self, N):
		return int((4 * N) ** (1 / 2))


class Solution:

	def getHypotenuse(self, N):
		import math
		return math.floor(2 * pow(N, 0.5))


class Solution:

	def getHypotenuse(self, N):
		return math.floor(math.sqrt(4 * N))


class Solution:

	def getHypotenuse(self, n):
		return int((4 * n) ** 0.5)


class Solution:

	def getHypotenuse(self, N):
		h = N ** 0.5
		b = 2 * h
		return int(b)


class Solution:

	def getHypotenuse(self, N):
		k = N ** 0.5
		c = k * 2
		return int(c)


class Solution:

	def getHypotenuse(self, N):
		import math as m
		return m.floor(m.sqrt(4 * N))


class Solution:

	def getHypotenuse(self, N):
		import math
		return math.floor((4 * N) ** 0.5)


class Solution:

	def getHypotenuse(self, N):
		import math
		a = math.sqrt(4 * N)
		return int(a)


class Solution:

	def getHypotenuse(self, N):
		import math
		hy = pow(4 * N, 0.5)
		return int(hy)


class Solution:

	def getHypotenuse(self, N):
		Length_square = 4 * N
		h = Length_square ** 0.5
		return math.floor(h)


class Solution:

	def getHypotenuse(self, N):
		r = N * 2
		a = pow(r, 0.5)
		x = a * a + a * a
		p = pow(x, 0.5)
		return int(p)


import math

class Solution:

	def getHypotenuse(self, N):
		hello = math.sqrt(N)
		if round(hello * 2) > hello * 2:
			return round(hello * 2) - 1
		else:
			return int(hello * 2)


class Solution:

	def getHypotenuse(self, N):
		import math
		return math.floor(pow(2 * (N * 2), 1 / 2))


class Solution:

	def getHypotenuse(self, N):
		import math
		b = math.sqrt(2 * N) * math.sqrt(2)
		H = b // 1
		return int(H)