Submission #23086

# Submission time Handle Problem Language Result Execution time Memory
23086 2017-05-02T17:21:25 Z model_code Tuna (COCI17_tuna) Python 3
50 / 50
24 ms 3 KB
N = int(input())
X = int(input())

cijena = 0

for i in range(N):
    P1, P2 = map(int, input().split())
    if abs(P1 - P2) <= X:
        cijena += max(P1, P2)
    else:
        cijena += int(input())

print(cijena)
# Verdict Execution time Memory Grader output
1 Correct 23 ms 3 KB Output is correct
2 Correct 23 ms 3 KB Output is correct
3 Correct 24 ms 3 KB Output is correct
4 Correct 23 ms 3 KB Output is correct
5 Correct 24 ms 3 KB Output is correct
6 Correct 24 ms 3 KB Output is correct
7 Correct 24 ms 3 KB Output is correct
8 Correct 23 ms 3 KB Output is correct
9 Correct 24 ms 3 KB Output is correct
10 Correct 24 ms 3 KB Output is correct