Two numbers

3

2 votes
, basic math, medium, Mathematics, mathematics, Basic Math, mathamatics, Math
Problem

You are given an integer N, and you need to find two numbers say x and y, such that the product of x and y is greater than or equal to N and the sum of x and y should be minimum. You need to print the minimum sum of x and y.

Input format

  • The first line denotes T denoting number of test cases
  • The second line denotes N

Output format

For each test case, print the minimum sum.

Constraints

1T105

1N1018

Sample Input
1
15
Sample Output
8
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

If you choose x=4 and y=4, the product will be 16 which is greater than 15 and the sum will be minimum, i.e 8.

Editor Image

?