Buggy python submission (verdict: Runtime Error):

N, T =map(int, input().split())
ts =map(int, input().split())



amount =0


    
for index in range(N-1):
    t_sub = ts[index+1]-ts[index]
    amount+=min(t_sub,T)

        
amount +=T

print(amount)

Fixed submission:
if __name__ == '__main__':
    N, T = map(int, input().split())
    ts = list(map(int, input().split()))
    
    
amount =0


    
for index in range(N-1):
    t_sub = ts[index+1]-ts[index]
    amount+=min(t_sub,T)

        
amount +=T

print(amount)

Buggy python submission (verdict: Runtime Error):
N,T =map(int,input().split())
t = map(int,input().split())
amount =0


    
for index in range(N-1):
    t_sub = t[index+1]-t[index]
    amount+=min(t_sub,T)

        
amount +=T

print(amount)

Fixed submission:
if __name__ == '__main__':
    N, T = map(int, input().split())
    ts = list(map(int, input().split()))
    
    
amount =0


    
for index in range(N-1):
    t_sub = ts[index+1]-ts[index]
    amount+=min(t_sub,T)

        
amount +=T

print(amount)

Buggy python submission (verdict: Runtime Error):
N,T =map(int,input().split())
t = map(int,input().split())
amount =0


    
for index in range(N-1):
    t_sub = t[index+1]-t[index]
    if t_sub <= T:
        amount+=t_sub
    else:
        amount+=T

        
amount +=T

print(amount)

Fixed submission:
if __name__ == '__main__':
    N, T = map(int, input().split())
    ts = list(map(int, input().split()))
    
    
amount =0


    
for index in range(N-1):
    t_sub = ts[index+1]-ts[index]
    amount+=min(t_sub,T)

        
amount +=T

print(amount)

Buggy python submission (verdict: Runtime Error):

N,T =map(int,input().split())
t = input().split()
amount =0


    
for index in range(N-1):
    t_sub = t[index+1]-t[index]
    if t_sub <= T:
        amount+=t_sub
    else:
        amount+=T

        
amount +=T

print(amount)

Fixed submission:
if __name__ == '__main__':
    N, T = map(int, input().split())
    ts = list(map(int, input().split()))
    
    
amount =0


    
for index in range(N-1):
    t_sub = ts[index+1]-ts[index]
    amount+=min(t_sub,T)

        
amount +=T

print(amount)

Buggy python submission (verdict: Runtime Error):
N,T = map(int,input().split())
t = input().split()
amount =0

if t[0] <= T:
    amount+=t[0]
else:
    amount+=T
    
for index in range(N-1):
    t_sub = int(t[index+1])-int(t[index])
    if t_sub <= T:
        amount+=t_sub
    else:
        amount+=T

        
amount +=T

print(amount)

Fixed submission:
if __name__ == '__main__':
    N, T = map(int, input().split())
    ts = list(map(int, input().split()))
    
    
amount =0


    
for index in range(N-1):
    t_sub = ts[index+1]-ts[index]
    amount+=min(t_sub,T)

        
amount +=T

print(amount)

Buggy python submission (verdict: Runtime Error):
N,T = map(int,input().split)
t = input().split()
int(amount) =0

if t[0] <= T:
    amount+=t[0]
else:
    amount+=T
    
for index in range(N-1):
    t_sub = int(t[index+1])-int(t[index])
    if t_sub <= T:
        amount+=t_sub
    else:
        amount+=T

        
amount +=T

print(amount)

Fixed submission:
if __name__ == '__main__':
    N, T = map(int, input().split())
    ts = list(map(int, input().split()))
    
    
amount =0


    
for index in range(N-1):
    t_sub = ts[index+1]-ts[index]
    amount+=min(t_sub,T)

        
amount +=T

print(amount)

Buggy python submission (verdict: Runtime Error):
N,T = map(int,input().split)
t = input().split()
amount =0

if t[0] <= T:
    amount+=t[0]
else:
    amount+=T
    
for index in range(N-1):
    t_sub = t[index+1]-t[index]
    if t_sub <= T:
        amount+=t_sub
    else:
        amount+=T

        
amount +=T

print(amount)

Fixed submission:
if __name__ == '__main__':
    N, T = map(int, input().split())
    ts = list(map(int, input().split()))
    
    
amount =0


    
for index in range(N-1):
    t_sub = ts[index+1]-ts[index]
    amount+=min(t_sub,T)

        
amount +=T

print(amount)