diff --git a/src/hiptobesquare.lua b/src/hiptobesquare.lua new file mode 100644 index 0000000..719b2da --- /dev/null +++ b/src/hiptobesquare.lua @@ -0,0 +1,4 @@ +for _ = 1, io.read("*n") do + n = io.read("*n") + print((math.floor(math.sqrt(n + 1)) - 1) // 2) +end diff --git a/src/hiptobesquare.py b/src/hiptobesquare.py new file mode 100644 index 0000000..a91d311 --- /dev/null +++ b/src/hiptobesquare.py @@ -0,0 +1,6 @@ +import math + +t = int(input()) +for _ in range(t): + n = int(input()) + print((math.floor(math.sqrt(n + 1)) - 1) // 2)