#C3607. Smallest Perfect Square Greater Than a Number
Smallest Perfect Square Greater Than a Number
Smallest Perfect Square Greater Than a Number
You are given t test cases. In each test case, you are provided with an integer n. Your task is to find the smallest perfect square that is strictly greater than n.
A perfect square is an integer that is the square of an integer. In mathematical terms, for each given integer \( n \), find the smallest integer \( x \) such that \( x = k^2 \) for some integer \( k \) and \( x > n \). To ensure accuracy in computations, you might find it useful to employ functions like the ceiling function combined with the square root.
Example:
Input: 3 5 10 20 Output: 9 16 25
inputFormat
The first line of input contains a single integer t
(\( 1 \leq t \leq 10^5 \)), the number of test cases. The second line contains t
integers separated by spaces, where each integer n
(\( 0 \leq n \leq 10^9 \)) represents one test case.
outputFormat
For each test case, output a single line containing the smallest perfect square that is strictly greater than the given number n
.
3
5 10 20
9
16
25
</p>