Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Aug 28, 2024
1 parent 94f77e3 commit c434795
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/beatspread.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
for _ = 1, io.read("*n") do
a, b = io.read("*n", "*n")
if a < b or (a + b) % 2 == 1 then
print("impossible")
else
print((a + b) // 2, (a - b) // 2)
end
end
3 changes: 3 additions & 0 deletions src/password.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
n = int(input())
p = [float(input().split()[-1]) for _ in range(n)]
print(sum(a * b for a, b in zip(sorted(p, reverse=True), range(1, n + 1))))

0 comments on commit c434795

Please sign in to comment.