Skip to content

Instantly share code, notes, and snippets.

@modos
Created July 16, 2022 01:40
Show Gist options
  • Save modos/3c281da341685cd41c2b306e89531fb0 to your computer and use it in GitHub Desktop.
Save modos/3c281da341685cd41c2b306e89531fb0 to your computer and use it in GitHub Desktop.
نمک زندگی
n, k = map(int, input().split())
d = {}
for i in range(n):
x, y = map(int, input().split())
if d.get((x, y), -1) == -1:
d[(x, y)] = 1
else:
d[(x, y)]+= 1
res = "YES"
for i, v in zip(d.keys(), d.values()):
#print(i[0], i[1], v)
if (i[1] - i[0] + 1) * k < v:
res = "NO"
break
print(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment