# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1103700 | zephyrion | Tuna (COCI17_tuna) | Cpython 3 | 14 ms | 2896 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
n = int(input())
x = int(input())
ans = 0
for i in range(n):
p1, p2 = map(int, input().split())
if abs(p1 - p2) <= x:
ans += max(p1, p2)
else:
ans += int(input())
print(ans)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |