Skip to content

Instantly share code, notes, and snippets.

@modos
Created October 26, 2022 10:34
Show Gist options
  • Save modos/9edaa7421d175055291fc1716e3876d6 to your computer and use it in GitHub Desktop.
Save modos/9edaa7421d175055291fc1716e3876d6 to your computer and use it in GitHub Desktop.
جشن هدیه ها
tedad = int(input())
dict = {}
for names in range(tedad):
dict[input()] = 0
for i in range(tedad):
a = input()
total, k = map(int, input().split())
if k != 0:
pool_a = total % k
nahaee = total - pool_a
dict[a] += -(nahaee)
else:
dict[a] += total
if k != 0:
pool_taghsim = total // k
for name in range(k):
b = input()
dict[b] += pool_taghsim
for key, val in dict.items():
print(key, val)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment