TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
import math
x =  [int(s) for s in input().split()]
aji = [x[1]+i-1 for i in range(x[0])]
sum = 0
for i in range(1,len(aji)):
    sum += aji[i]
print(sum)
   

import math
x =  [int(s) for s in input().split()]
aji = [x[1]+i-1 for i in range(1,x[0]+1)]
print(aji)
sum = 0
if(0 in aji):
    for i in range(0,len(aji)):
        sum += aji[i]
else:
    for i in range(1,len(aji)):
        sum += aji[i]
print(sum)

# coding: utf-8
# Your code here!
import math
x =  [int(s) for s in input().split()]
aji = [x[1]+i-1 for i in range(1,x[0]+1)]

sum = 0
for i in range(0,len(aji)):
        sum += aji[i]

sum2 = 0
if(0 in aji):
    for i in range(0,len(aji)):
        sum2 += aji[i]
else:
    if(sum < 0):
        for i in range(0,len(aji)-1):
            sum2 += aji[i]
    else:
        for i in range(1,len(aji)):
            sum2 += aji[i]
print(sum2)
   
            
            

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n,l=map(int,input().split())
v=[l+i-1for i in range(1,n+1)]
print(n,l,v)
if l>=0:
  v.pop(0)
elif n<=abs(l): 
  v.pop(n-1)
print(sum(v))

n,l=map(int,input().split())
v=[l+i-1for i in range(1,n+1)]
if l>=0:
  v.pop(0)
elif n<=abs(l): 
  v.pop(n-1)
print(sum(v))


Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N, L = map( int, input().split())

i = min( 0, ( L - 1 ) )
print( N * ( L - 1 ) + N * ( N - 1 ) // 2 - i )

N, L = map( int, input().split())


assumed_apple_pie = ( L - 1 ) * N + sum( range( 1, N + 1 ) )



edible_apple = 0
if L > 0:
  edible_apple = L
elif ( L + N - 1 ) < 0:
  edible_apple = L + N - 1

real_apple_pie = assumed_apple_pie - edible_apple

print( real_apple_pie )

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
hoge = input().split()
N = int(hoge[0])
L = int(hoge[1])

if L > 0:
  print("a")
  erase_apple = 0
elif L+N-1 >= 0:
  for i in range(N):
    if i + L == 0:
      break
else:
  erase_apple = N-1

print(erase_apple)
apples = []
for i in range(N):
  apples.append(L+i)

apples.pop(erase_apple)
print(sum(apples))

hoge = input().split()
N = int(hoge[0])
L = int(hoge[1])

if L > 0:
  erase_apple = 0
elif L+N > 0:
  for i in range(N):
    if i + L == 0:
      erase_apple = i
      break
else:
  erase_apple = N-1

if erase_apple == N:
  erase_apple = N-1
  
print(erase_apple)
  
apples = []
for i in range(N):
  apples.append(L+i)

apples.pop(erase_apple)
print(sum(apples))

hoge = input().split()
N = int(hoge[0])
L = int(hoge[1])

if L > 0:
  erase_apple = 0
elif L+N >= 0:
  for i in range(N+1):
    if i + L == 0:
      erase_apple = i
      break
else:
  erase_apple = N-1

if erase_apple == N:
  erase_apple = N-1

apples = []
for i in range(N):
  apples.append(L+i)

apples.pop(erase_apple)
print(sum(apples))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N, L = map(int, input().split())
for i in range(N):
  l.append(abs(L + i))
l.sort()
l.pop(0)
print(sum(l))

N, L = map(int, input().split())
l = []
for i in range(N):
  l.append(L + i)
l.sort()
if 0 in l:
  print(sum(l))
else:
  if l[0] > 0:
    l.pop(0)
    print(sum(l))
  else:
    l.pop(-1)
    print(sum(l))


Verdicts: Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
s = input()

for i in range(len(s)-1):
    if s[i] == s[i+1]:
        print("Bad")
        exit()
else:
    print("Good")

n,l = map(int,input().split())
m = 300

for i in range(l,n+l):
    m = min(abs(m),abs(i))
    if i < 0:
        m *= -1
else:
    print(sum(range(l,n+l))-m)

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N, L = map(int, input().split())

taste = [i for i in range(N)]

for i in range(N):
  taste[i] = taste[i] + L
  
  
sum_taste = sum(taste)

result = 10 ** 10
for i in range(N):
  if abs(sum_taste - taste[i]) < result:
    result = sum_taste - taste[i]
    
print(result)

N, L = map(int, input().split())

taste = [i for i in range(N)]

for i in range(N):
  taste[i] = taste[i] + L
  
  
sum_taste = sum(taste)

result = 10 ** 10
for i in range(N):
  if abs(sum_taste - taste[i]) < result:
    result = sum_taste - taste[i]
    
print(result)

N, L = map(int, input().split())

taste = [i for i in range(N)]

for i in range(N):
  taste[i] = taste[i] + L
  
  
sum_taste = sum(taste)

result = 10 ** 10
for i in range(N):
  if abs(sum_taste - taste[i]) < abs(result):
    result = sum_taste - taste[i]
    
print(result)

N, L = map(int, input().split())

state = [0 for _ in range(N)]

for i in range(N):
    state[i] = L + i

tmp = 10 ** 9

for i in range(N):
    tmp = min(tmp, sum(state)-state[i])
print(tmp)


N, L = map(int, input().split())

state = [0 for _ in range(N)]

for i in range(N):
    state[i] = L + i

tmp = 10 ** 9

for i in range(N):
    if tmp > abs(sum(state) - sum(state)-state[i]):
        tmp = abs(sum(state) - sum(state)-state[i])
        res = sum(state) - state[i]

print(res)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N,L=map(int,input().split())
lis=[]
for i in range(N):
    lis.append(L+i)
if 0 in lis:
    print(sum(lis))
else:
    lis2=sorted(lis)
    print(sum(lis2[1:-1])+min(lis2[0],lis2[-1]))

N,L=map(int,input().split())
lis=[]
for i in range(N):
    lis.append(L+i)
if 0 in lis:
    print(sum(lis))
else:
    lis2=sorted(lis)
    ans=sum(lis2[1:-1])
    if lis2[0]/abs(lis2[0])==-1:
        ans+=lis2[0]
    else:
        ans+=lis2[-1]
    print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
taste_all = 0
list1 = []
N, L = map(int, input().split()) 
for i in range(1,N+1):
    taste = L + i -1
    list1.append(taste)
    taste_all =taste_all + taste
z = 10000000
anser = 10000000
b = 0
c = 0
for j in range(N):
    a = list1.pop(j)
    b = sum(list1)
    z = abs(taste_all-b)
    anser = min(z,anser)
    c = c + 1
    list1.insert(j,a)
c = list1.pop(c-1)
anser = sum(list1)
print(anser)

check = 10000000
taste_all = 0
list1 = []
N, L = map(int, input().split()) 
for i in range(1,N+1):
    taste = L + i -1
    if (check > abs(taste)):
        check = min (check,abs(taste))
        remove_apple = taste
    list1.append(taste)
    taste_all =taste_all + taste
list1.remove(remove_apple)

print(sum(list1))

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N, L = map(int, input().split())

sum_N = N*((N+1)/2 + L - 1)

if L >= 0 :
  print(sum_N - L)
elif L + N - 1 < 0 :
  print(sum_N - (L + N - 1))
else :
  print(sum_N)


N, L = map(int, input().split())

sum_N = N*((N+1)/2 + L - 1)

if L >= 0 :
  print(sum_N - L)
else if L + N - 1 < 0 :
  print(sum_N - (L + N - 1))
else :
  print(sum_N)

N, L = map(int, input().split())

sum_N = int(N*((N+1)/2 + L - 1))

if L >= 0 :
  print(sum_N - L)
elif L + N - 1 < 0 :
  print(sum_N - (L + N - 1))
else :
  print(sum_N)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
# -*- coding: utf-8 -*-

N, L = map(int, input().split())

A = [L+i-1 for i in range(1, N+1)]

A_abs = [abs(x) for x in A]
abs_min = min(A_abs)
index = A_abs.index(abs_min)
eat = A[index]
print(sum(A))

ans = sum(A) - eat
print(ans)

# -*- coding: utf-8 -*-

N, L = map(int, input().split())

A = [L+i-1 for i in range(1, N+1)]

A_abs = [abs(x) for x in A]
abs_min = min(A_abs)
index = A_abs.index(abs_min)
eat = A[index]
ans = sum(A) - eat
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):

tastes = []
for i in range(n):
    tastes += [l+i]


if 0 in tastes:
    print(sum(tastes))
else:
    
    tastes.sort(key=abs)
    print(sum(tastes[1:]))


n, l = map(int, input().split())


tastes = []
for i in range(n):
    tastes += [l+i]


if 0 in tastes:
    print(sum(tastes))
else:
    
    tastes.sort(key=abs)
    print(sum(tastes[1:]))

Verdicts: Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
# ABC131A

s = input()
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print('Bad')
else:
    print('Good')


# ABC131B

import numpy as np
n, l = map(int, input().split())
x = l+np.arange(n)
print(sum(x) - x[np.argmin(abs(x))])


Verdicts: Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):

import numpy as np

N, L = map(int, input().input())


def taste(N, L):
    all = np.array([np.abs(L + i - 1) for i in range(1, N + 1)])
    return all

tastes = taste(N, L)
import numpy as np

N, L = map(int, input().input())


def taste(N, L):
    all = np.array([np.abs(L + i - 1) for i in range(1, N + 1)])
    return all

tastes = taste(N, L)
all = tastes[np.min(tastes) != tastes]

re = np.sum(all)
print(re)
all = tastes[np.min(tastes) != tastes]

re = np.sum(all)
print(re)

import numpy as np


def taste(N, L):
    all_abs = np.array([np.abs(L + i - 1) for i in range(1, N + 1)])
    all_base = np.array([L + i - 1 for i in range(1, N + 1)])

    return all_abs, all_base

N, L = map(int, input().input())

all_abs, all_base = taste(N, L)

N_1_all = all_base[np.min(all_abs) != all_abs]

re = np.sum(N_1_all)
print(re)


import numpy as np
 
 
def taste(N, L):
    all_abs = np.array([np.abs(L + i - 1) for i in range(1, N + 1)])
    all_base = np.array([L + i - 1 for i in range(1, N + 1)])
 
    return all_abs, all_base
 
N, L = map(int, input().split())
 
all_abs, all_base = taste(N, L)
 
N_1_all = all_base[np.min(all_abs) != all_abs]
 
re = np.sum(N_1_all)
print(re)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n,l = int(input())
tastes = [(i + l) for i in range(n)]
t = tastes.copy()
for j in range(n):
    t[j] = abs(t[j])
del tastes[t.index(min(t))]
print(sum(tastes))

n,l = map(int, input().split())
tastes = [(i + l) for i in range(n)]
t = tastes.copy()
for j in range(n):
    t[j] = abs(t[j])
del tastes[t.index(min(t))]
print(sum(tastes))

Verdicts: Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N,L = map(int,input().split())
    eat = N - 1
    for m in range(N):
        if abs(L + m) < abs(L + eat):
            eat = m
aj = N*(N-1)//2
pie = (N-1)*L + aj - eat
print(pie)


N,L = map(int,input().split())
eat = N - 1
for m in range(N):
    if abs(L + m) < abs(L + eat):
        eat = m
aj = N*(N-1)//2
pie = (N-1)*L + aj - eat
print(pie)


Verdicts: Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n,l=map(int,input().split())
t=[]
p=[]
for i in range(n):
    t.append(l+i)
    if l+i>=0:
        p.append(l+i)
if p=[]:
    print(sum(t)-max(t))
else:
    print(sum(t)-min(p))


n,l=map(int,input().split())
t=[]
p=[]
for i in range(n):
    t.append(l+i)
    if l+i>=0:
        p.append(l+i)
if p==[]:
    print(sum(t)-max(t))
else:
    print(sum(t)-min(p))


Verdicts: Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N, L = map(int,input().split(' '))

arr = []
tmp = L
for i in range(N):
    arr.append(tmp)
    tmp += 1

total = 0
if L + N < 0:
    arr.sort(reverse=True) 
print(arr)
if 0 in arr:
    arr.remove(0)
else:
    arr.pop(0)

for i in arr[:]:
    total += i
print(arr)
print(total)

N, L = map(int,input().split(' '))
arr = [i+L for i in range(N)]

if 0 in arr:
    arr.remove(0)
else:
    if L + N <= 0:
        arr.sort(reverse=True) 
    arr.pop(0)

print(sum(arr))

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
num, t = map(int, input().split())
taste = []
findmin = []

sum= 0
for i in range(len(num)):
  taste.append(t+i-1)
  sum += t+i-1
for j in range(len(taste)):
  findmin.append(j*j)
m = findmin.index(min(findmin))
print(sum - taste[m])





num, t = map(int, input().split())
taste = []
findmin = []

sum= 0
for i in range(1,len(num)+1):
  taste.append(t+i-1)
  sum += t+i-1
for j in range(len(taste)):
  findmin.append(j*j)
m = findmin.index(min(findmin))
print(sum - taste[m])





num, t = map(int, input().split())
taste = []
findmin = []

sum= 0
for i in range(1,num + 1):
  taste.append(t+i-1)
  sum += t+i-1
for j in range(len(taste)):
  findmin.append(taste[j]*taste[j])
m = findmin.index(min(findmin))
print(sum - taste[m])


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n, l = map(int, input().split())

aji = (l + l+n-1)*(n/2)

if l >= 0 :
    ans = aji - l

elif abs(l)-n >= 0 :
    ans = aji - (l+n-1)
else :
    ans = aji

print(ans)


n, l = map(int, input().split())

aji = (l + l+n-1)*(n/2)

if l >= 0 :
    ans = aji - l
elif l < 0 and l+n <= 0 :
    ans = aji - (l+n-1)
else :
    ans = aji

print(int(ans))


Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
lst = input()
lst = lst.split()


for i in range(len(lst)):
    lst[i]= int(lst[i])
N = lst[0]
L = lst[1]
q = L
l = 0
lste = [abs(L)]
tlst = []
for i in range(2,N+1):
    t = L+i-1
    q += t
    tlst.append(t)
    t = abs(t)
    lste.append(t)


slst = sorted(lste)
print(slst)
l = slst[0]
if tlst.count(-l) > 0:
    print('ok')
    print(q+l)
else:
    print(q-l)

lst = input()
lst = lst.split()


for i in range(len(lst)):
    lst[i]= int(lst[i])
N = lst[0]
L = lst[1]
q = L
l = 0
lste = [abs(L)]
tlst = []
for i in range(2,N+1):
    t = L+i-1
    q += t
    tlst.append(t)
    t = abs(t)
    lste.append(t)


slst = sorted(lste)
l = slst[0]
if tlst.count(-l) > 0:
    print(q+l)
else:
    print(q-1)

lst = input()
lst = lst.split()


for i in range(len(lst)):
    lst[i]= int(lst[i])
N = lst[0]
L = lst[1]
q = L
l = 0
lste = [abs(L)]
tlst = []
for i in range(2,N+1):
    t = L+i-1
    q += t
    tlst.append(t)
    t = abs(t)
    lste.append(t)


slst = sorted(lste)
l = slst[0]
if tlst.count(-l) > 0:
    print(q+l)
else:
    print(q-l)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n,l = map(int, input().split())
L = [0]*n
#l+i-1
for i in range(n):
  L[i] += l+i

if(l < 0 and n + l < 0):
  print(sum(L) - L[n-1])
elif(l =< 0 and n + l >= 0):
  print(sum(L))
else:
  print(sum(L) - L[0])


n , l = map(int, input().split())
L = []

for i in range(n):
    L.append(i+l)

if L[0] > 0:
    print(sum(L[1:]))
elif L[0] <=0 and L[-1] >= 0:
    print(sum(L))
else:
    print(sum([:-1]))


n , l = map(int, input().split())
L = []

for i in range(n):
    L.append(i+l)

if L[0] > 0:
    print(sum(L[1:]))
elif L[0] <=0 and L[-1] >= 0:
    print(sum(L))
else:
    print(sum(L[:-1]))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N,L = map(int,input().split())
count = L
taste = []
for i in range(N):
    taste.append(count)
    count += 1
if 0 in taste:
    taste.remove(0)
elif  N + L <= 0:
    taste.pop(-1)
else:
    taste.pop(0)
print(taste)

N,L = map(int,input().split())
count = L
taste = []
for i in range(N):
    taste.append(count)
    count += 1
if 0 in taste:
    taste.remove(0)
elif  N + L <= 0:
    taste.pop(-1)
else:
    taste.pop(0)
print(sum(taste))

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n, l = map(int, input().split())
apples = [l+i-1 for i in range(n)]
apples.sort(key=lambda x: abs(x))

del apples[0]
print(sum(apples))

n, l = map(int, input().split())
apples = [l+i-1 for i in range(1, n+1)]
apples.sort(key=lambda x: abs(x))

del apples[0]
print(sum(apples))

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N, L = map(int,input().split())
taste = [ L + i for i in range(N) ]

abs_min_taste = 9999
min_i = -1
for i in range(N):
    if abs_min_taste > abs(taste[i]):
        min_i = i
        abs_min_taste = abs(taste[i])

sum_taste = sum(taste)
ans = sum_taste - taste[min_i]

N, L = map(int,input().split())
taste = [ L + i for i in range(N) ]

abs_min_taste = 9999
min_i = -1
for i in range(N):
    if abs_min_taste > abs(taste[i]):
        min_i = i
        abs_min_taste = abs(taste[i])

sum_taste = sum(taste)
ans = sum_taste - taste[min_i]
#print(N, L, taste, abs_min_taste, ans)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N, L = map(int,input().split())

ans == 0
for i in range(1,n+1):
  p = list[L+i-1]
  ans += p[i]

print(ans)

N, L = map(int,input().split())

total = N*(2*L+N-1)

if L>=0:
	small = L
elif L<0 and L+N-1>=0:
	small = 0
else:
	small = L+N-1
print(total - small)



N, L = map(int,input().split())

total = N*(2*L+N-1)//2

if L>=0:
	small = L
elif L<0 and L+N-1>=0:
	small = 0
else:
	small = L+N-1
print(total - small)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n, l = map(int, input().split())
a = sorted([l + i for i in range(n)], key=abs)
print(sum(s[1:]))



n, l = map(int, input().split())
a = sorted([l + i - 1 for i in range(1, n-1)])
print(sum(a) - a[0] if abs(a[0]) > abs(a[-1]) else sum(a) - a[-1])


n, l = map(int, input().split())
a = sorted([l + i for i in range(n)], key=abs)
print(sum(a[1:]))



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
l = list(map(int,input().split()))
N = l[0]
L = l[1]

apple =[]

for i in range(N):
    apple.append(L + i)

print(apple)
pie = 0
flag = 1
min = abs(L)
for i in range(N):
    pie = pie + apple[i]
    if abs(apple[i]) < min:
        min = abs(apple[i])
        if apple[i]<0:
            flag = -1
        else:
            flag = 1

print(min)
pie = pie - flag * min

print(pie)


l = list(map(int,input().split()))
N = l[0]
L = l[1]

apple =[]

for i in range(N):
    apple.append(L + i)
print(apple)

pie = 0
min = abs(L)
for i in range(N):
    pie = pie +apple[i]
    if abs(apple[i])< min:
        min = apple[i]

pie = pie - min

print(pie)


l = list(map(int,input().split()))
N = l[0]
L = l[1]

apple =[]

for i in range(N):
    apple.append(L + i)

pie = 0
flag = 1
min = abs(L)
for i in range(N):
    pie = pie + apple[i]
    if abs(apple[i]) < min:
        min = abs(apple[i])
        if apple[i]<0:
            flag = -1
        else:
            flag = 1

pie = pie - flag * min

print(pie)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n,l=map(int,input().split())
ans=888
SUM=0
s=0
for i in range(l,l+n):
        SUM+=i
        s=i
        if i<0:
                s=1
                i*=-1
        else:
                s=-1
        if ans>i:
                ans=i
        print(i,ans)
y=range(l,l+n)
ANS=SUM+s*ans
print(ANS)

n,l=map(int,input().split())
ans=888
SUM=0
s=0
for i in range(l,l+n):
        SUM+=i
        s=i
        if i<0:
                s=1
                i*=-1
        else:
                s=-1
        if ans>i:
                ans=i
       
y=range(l,l+n)
ANS=SUM+s*ans
print(ANS)

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n,l=map(int,input().split())
print(((l+n-1)*(l+n)-l*(l+1))//2-l if l>=0 else (((l+n-1)*(l+n)-l*(l+1))//2 if l<0 and l+n>0 ((l+n-1)*(l+n)-l*(l+1))//2-(l+n-1)))

n,l=map(int,input().split())
m=[l+i for i in range(n)]
s=sum(m)
t=101
d=0
for i in range(n):
  if t>abs(m[i]):
    t=abs(m[i])
    d=m[i]
print(s-d)

Verdicts: Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
import sys

if __name__ == '__main__':
    N, A = sys.argv[1:]
    assert 2<=int(N)<=200
    assert -100<=int(A)<=100

    L = int(A)
    R = int(A)+int(N)-1

    if R <= 0:
        eat = R
    elif L >= 0:
        eat = L
    else:
        eat = 0

    ans = (R+L)*(R-L+1)//2-eat
    print(ans)


if __name__ == '__main__':
    N, A = input().split()[0:]
    assert 2<=int(N)<=200
    assert -100<=int(A)<=100

    L = int(A)
    R = int(A)+int(N)-1

    if R <= 0:
        eat = R
    elif L >= 0:
        eat = L
    else:
        eat = 0

    ans = (R+L)*(R-L+1)//2-eat
    print(ans)


Verdicts: Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N,L = list(map(int,input().split(" ")))

apple = list(range(L,L+N))

s = sum(apple)

m = 1000000000000000000
for x in apple:
  if abs(m) > abs(x):
    m = abs(x)

print(s-x)

N,L = list(map(int,input().split(" ")))

apple = list(range(L,L+N))

s = sum(apple)

m = 10000000000000
for x in apple:
  if abs(m) > abs(x):
    m = x

print(s-m)

Verdicts: Wrong Answer

Accepted