# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1103699 | 2024-10-21T14:40:26 Z | zephyrion | Tuna (COCI17_tuna) | C++17 | 0 ms | 0 KB |
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)