CBOJ Fall Challenge '24 P1 - Building Squares
Submit solution
Points:
3
Time limit:
2.0s
Memory limit:
256M
JavaScript (Node.js)
320M
Author:
Problem type
John is attempting to construct a perfect square using \(1\) x \(1\) tiles. Currently, he possesses \(X\) tiles and he wants to create a square using all the tiles he has.
Determine the minimum number of additional tiles that John needs to purchase in order to create a complete square.
Constraints
\(1 \le X \le 100\)
Input Specification
The first line of input contains one integer, \(X\), the number of tiles that John currently has.
Output Specification
Output the minimum amount of more tiles he needs to create a square.
Sample Input
7
Sample Output
2
Comments