Created
October 26, 2022 10:34
-
-
Save modos/9edaa7421d175055291fc1716e3876d6 to your computer and use it in GitHub Desktop.
جشن هدیه ها
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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