From 0d3e5bb03fc1de49cd4c8734ea86ad069e6f5b48 Mon Sep 17 00:00:00 2001 From: Zeheng Li Date: Mon, 16 Dec 2024 16:16:08 -0700 Subject: [PATCH] add examples --- src/hiptobesquare.lua | 4 ++++ src/hiptobesquare.py | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 src/hiptobesquare.lua create mode 100644 src/hiptobesquare.py 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)