Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Dec 16, 2024
1 parent b74d291 commit 0d3e5bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hiptobesquare.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
for _ = 1, io.read("*n") do
n = io.read("*n")
print((math.floor(math.sqrt(n + 1)) - 1) // 2)
end
6 changes: 6 additions & 0 deletions src/hiptobesquare.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 0d3e5bb

Please sign in to comment.