diff --git a/src/astackofgold.lua b/src/astackofgold.lua new file mode 100644 index 00000000..6d132546 --- /dev/null +++ b/src/astackofgold.lua @@ -0,0 +1,2 @@ +w, s = io.read("*n","*n") +print((w - s * (s + 1) // 2 * 29260) // 110) diff --git a/src/astackofgold.py b/src/astackofgold.py new file mode 100644 index 00000000..a69965b6 --- /dev/null +++ b/src/astackofgold.py @@ -0,0 +1,2 @@ +w, s = [int(d) for d in input().split()] +print((w - s * (s + 1) // 2 * 29260) // 110) diff --git a/src/sauna.lua b/src/sauna.lua new file mode 100644 index 00000000..f47876b4 --- /dev/null +++ b/src/sauna.lua @@ -0,0 +1,19 @@ +n = io.read("*n") +ma, mb = -1, 200001 +for _ = 1, n do + a, b = io.read("*n", "*n") + if a > ma then + ma = a + end + if b < mb then + mb = b + end + if ma > mb then + break + end +end +if ma <= mb then + print(mb - ma + 1, ma) +else + print('bad news') +end