TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
N = int(input())
d = [int(input()) for i in range(N)]
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

N = int(input())
S = input()
 
ans = 1
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ans = ans + 1
print(ans)

N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    for j in range range(i-1):
        sum = sum + d[i] * d[j]
print(sum)

N = int(input())
d = list(map(int, input().split()))
sum = 0
for i in range(N):
    for j in range range(i-1):
        sum = sum + d[i] * d[j]
print(sum)

N = int(input())
S = list(input().split())
 
ans = 1
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ans = ans + 1
print(ans)

N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

A, B = map(int, input().split())
if A - 2 * B < 0 or A-2*B == 0:
    print(0)
else:
    print(A - 2 * B)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
def main():
    a, b = map(int, input().split())
    ans = min(a - 2 * b, 0)
    print(ans)


if __name__ == "__main__":
    main()


def main():
    a, b = map(int, input().split())
    ans = max(a - 2 * b, 0)
    print(ans)


if __name__ == "__main__":
    main()


Verdicts: Wrong Answer

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):

def main():
    a, b = map(int, input().split())
    if a < b * 2:
        print(a - b * 2)
    else:
        print(0)


if __name__ == "__main__":
    main()



def main():
    a, b = map(int, input().split())
    if a < b * 2:
        print(0)
    else:
        print(a - b * 2)


if __name__ == "__main__":
    main()


Verdicts: Wrong Answer

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a,b=map(int,input().split())
if a-2b>=0:
   print(a-2b)
else:
  print(0)

a,b=map(int,input().split())
if a-2*b<0:
  print(0)
else:
  print(a-2*b)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a,b=map(int,input().split())
if a<=2*b:
  print(0)
else:
  print(2*b-a)

a,b=map(int,input().split())
if a<=2*b:
  print(0)
else:
  print(a-2*b)

Verdicts: Wrong Answer

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
import itertools as it 

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

l.sort()

triangles = set()
for a, b, c in it.combinations(l, 3):
    if a + b > c and b + c > a and a + c > b:
        triangles.add((a, b, c))

print(len(triangles))

a, b = map(int, input().split())

print(max(a - 2 * b, 0))


Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
n=input()
a,b,c=map(int,input().split())


a,b=map(int,input().split())
c=a-b*2
if 0>c:
    print(0)
else:
    print(c)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a,b=map(int,input())
print(a-b*2 if (a-b*2>0) else 0)

a,b=map(int,input().split())
print(a-b*2 if (a-b*2>0) else 0)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a,b = map(int,input().split())

print(min(0,a-(b*2)))

a,b = map(int,input().split())
 
print(max(0,a-(b*2)))

Verdicts: Wrong Answer

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
N = int(input())
S = input()

List_S = list(S)
Ans = 1

for i in range(N-1):
    if List_S[i] != List_S[i+1]:
        Ans += 1
    
print(Ans)


print("A, B =")
A,B = input().split()

C = int(A) - int(B) * 2

if C < 0:
    print(0)
elif C > 100:
    print(100)
else:
    print(C)


import numpy

print("A = ")
A = input()

print("B = ")
B = input()

C = int(A) - int(B) * 2

if C < 0:
    print(0)
elif C > 100:
    print(100)
else:
    print(C)

A,B = input().split()

C = int(A) - int(B) * 2

if C < 0:
    print(0)
elif C > 100:
    print(100)
else:
    print(C)


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):

def run_length(s) -> list:
  res = [[s[0], 1]]
  for i in range(1, len(s)):
    if res[-1][0] == s[i]:
      res[-1][1] += 1
    else:
      res.append([s[i], 1])
  return res


# print(RL)



def run_length(s) -> list:
  res = [[s[0], 1]]
  for i in range(1, len(s)):
    if res[-1][0] == s[i]:
      res[-1][1] += 1
    else:
      res.append([s[i], 1])
  return res



# print(RL)




# print(RL)



def run_length(s) -> list:
  res = [[s[0], 1]]
  for i in range(1, len(s)):
    if res[-1][0] == s[i]:
      res[-1][1] += 1
    else:
      res.append([s[i], 1])
  return res




A,B=map(int,input().split())
print(max(0,A-2*B))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
mado = int(input())
ka-ten = int(input())
 
n = mado - (ka-ten*2)
 
if n >= 0:
  print(n)
else:
  print(0)

mado = input()
ka-ten = input()

n = mado - (ka-ten*2)

if n >= 0:
  print(n)
else:
  print(0)

MK = input()
mado = int(MK.split(" ")[0])
katen = int(MK.split(" ")[1])
 
n = mado - (katen*2)
 
if n >= 0:
  print(n)
else:
  print(0)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A = int(input())
B = int(input())
 
answer = A - 2*B
if answer < 0:
  answer = 0
 
print(answer)

A = input()
B = input()

answer = A - 2B
if answer < 0:
  answer = 0

print(answer)

A,B=map(int, input().split()) 
answer = A - 2*B
if answer < 0:
  answer = 0
 
print(answer)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a b = map(int, input().split())
ans = a-2*b
if ans >= 0:
  print(ans)
else:
  print(0)

a, b = map(int, input().split())
ans = a-2*b
if ans >= 0:
  print(ans)
else:
  print(0)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
import itertools


def actual(n, D):
    
    comb = itertools.combinations(D, 2)

    # return sum([x * y for x, y in comb])

    
    
    
    #     for j in range(i + 1, len(D)):
    
    #
    # return s

    
    s = 0
    for i in range(len(D) - 1):
        s += D[i] * sum(D[i + 1:])
    
    return s


n = int(input())
D = list(map(int, input().split()))

print(actual(n, D))


import itertools


def actual(n, D):
    
    comb = itertools.combinations(D, 2)

    # return sum([x * y for x, y in comb])

    
    
    
    #     for j in range(i + 1, len(D)):
    
    #
    # return s

    
    s = 0
    for i in range(len(D) - 1):
        s += D[i] * sum(D[i + 1:])

    return s


n = int(input())
D = list(map(int, input().split()))

print(actual(n, D))


a, b = map(int, input().split())

if a <= b * 2:
	print(0)
else:
	print(a - b * 2)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
from bisect import bisect_right
N = int(input())
D = list(map(int, input().split()))
D.sort(reverse=False)

count = 0

for i in range(N - 2):
    for j in range(i + 1, N - 1):
        l = D[:N - j - 1]
        ind = bisect_right(D, D[i] + D[j] - 1)
        count += max(ind - j - 1, 0)

print(count)


D = input().split(' ')
A = int(D[0])
B = int(D[1])

res = A - B * 2

if res < 0:
    res = 0

print(res)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
n=int(input())
d = list(map(int, input().split()))
a=0
for i in range(0,n,1):
  if d[i]==d[-1]:
     break
  if n==i+1:
     a+=d[i]*d[i+1]
     break
  for j in d[i+1:]:
    a+=d[i]*j
print(a)

n=int(input())
d = list(map(int, input().split()))
a=0
for i in range(0,n,1):
  if d[i]==d[-1]:
    break
  if n==i+1:
    a+=d[i]*d[i+1]
    break
  for j in d[i+1:]:
    a+=d[i]*j
print(a)

a, b=map(int, input().split())
if a-b*2<=0:
  print(0)
else: 
  print(a-b*2)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A, B = map(int, input().split())
print(A-2B)


A, B = map(int, input().split())
if A-2*B > 0:
  print(A-2*B)
else:
  print(0)
  

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a, b = map(int, input().split())
if a<=b*2:
    print(0)
else:
    print(a-b*2)a, b = map(int, input().split())
if a<=b*2:
    print(0)
else:
    print(a-b*2)

a, b = map(int, input().split())
if a<=b*2:
    print(0)
else:
    print(a-b*2)a, b = map(int, input().split())


a, b = map(int, input().split())
if a<=b*2:
    print(0)
else:
    print(a-b*2)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A = int(input())
B = int(input())
if (A - 2 * B) >= 0:
  print (A - 2 * B)
else:
  print('0')

if (A - 2 * B) >= 0:
  print (A - 2 * B)
else:
  print('0')

a, b=map(int, input().split())
if a-2*b>=0:
  print(a-2*b)
else:
  print(0)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
import heapq

n, m, l = map(int, input().split())
v = [[] for i in range(n)]
for i in range(m):
    a, b, c, = map(int, input().split())
    a, b, = a-1, b-1
    if c > l:
        continue
    v[a].append((c, b))
    v[b].append((c, a))


def dijkstra(home):
    visited = [False for i in range(n)]
    visited[home] = -1
    queue = []
    for edge in v[home]:
        heapq.heappush(queue, edge)


    while queue:
        value, x = heapq.heappop(queue)
        if visited[x]:
            continue
        visited[x] = value
        for new_value, new_x in v[x]:
            if not visited[new_x]:
                heapq.heappush(queue, new_value+value)

    return visited


def dijkstra2(home):
    visited = [None for _ in range(n)]
    visited[home] = 0
    queue = []
    for fuel_needed, x in v[home]:
        heapq.heappush(queue, (0, fuel_needed, x))


    while queue:
        tanked, fuel_needed, x = heapq.heappop(queue)
        fuel = l-fuel_needed
        if visited[x] is not None:
            continue
        visited[x] = tanked
        for child_value, child_x in v[x]:
            if visited[child_x] is None:
                if child_value > fuel:
                    heapq.heappush(queue, (tanked+1, child_value, child_x))
                else:
                    heapq.heappush(queue, (tanked, fuel_needed+child_value, child_x))

    return visited






visited_collection = [None for _ in range(n)]



q = int(input())
queries = []
for i in range(q):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    if visited_collection[a]:
        print(visited_collection[a][b] if visited_collection[a][b] is not None else -1)
    elif visited_collection[b]:
        print(visited_collection[b][a] if visited_collection[b][a] is not None else -1)
    else:
        visited_collection[a] = dijkstra2(a)
        print(visited_collection[a][b] if visited_collection[a][b] is not None else -1)

    








a, b, = map(int, input().split())
print(0 if 2*b >= a else a - 2*b)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A = list(map(int, input().split())) 
return max(0,A[0]-2*A[1])

A = list(map(int, input().split())) 
print(max(0,A[0]-2*A[1]))

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A, B = map(int, input().split(''))
if A - B * 2 > 0:
    print(A - B * 2)
else:
    print(0)

A,B = map(int,input().split)
if A - B * 2 > 0:
    print(A - B * 2)
else:
    print(0)

a, b = map(int, input().split())  
if a - b * 2 > 0:
    print(a - b * 2)
else:
    print(0)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A = input()
B = input()

if B > A/2:
  print(0)
else:
  print(A-2*B)

a, b = map(int, input().split())

answer = a - 2 * b

if (answer < 0):
  print(0)
else:
  print(answer)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a,b=int(input().split())
if a-2*b>0:
  　　print(a-2*b)
else:
　　　　print(0)


a,b=int(input().split())
if a-2*b>0:
  print(a-2*b)
else:
  print(0)


a,b=int(input().split())
if a-2*b>0:
  print(a-2*b)
else:
  print(0)


a,b=map(int,input().split())
if a-2*b>0:
    print(a-2*b)
else:
    print(0)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a, b = map(int, input().split())
print(max(0,a-(b*2))

a, b = map(int, input().split())
print(max(0,a-(b*2)))

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a,b = map(int,input().split())
if (a/2 - b) <= 0:
    print(0)
else:
    print(a - b*b)

a,b = map(int,input().split())
if (a/2 - b) <= 0:
    print(0)
else:
    print(a - b*2)

Verdicts: Wrong Answer

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a,b=map(int(),input.split())
print(a-2b)

a,b = map(int,input().split())
c = 2*b
d = a-c
if d > 0:
print(d)
elif d <= 0:
print(0)

a,b=map(int,input().split())
if a>2*b:
print(a-2*b)
else if:
print(0)

a,b=map(int,input().split())
print(a-2b)


a,b=map(int,input().split())
c=a-2b
print(c)

a,b=map(int,input().split())
c=2*b
d=a-c
if a>c:
print(d)
else:
print(0)

a,b = map(int,input().split())
c = 2*b
d = a-c
if d > 0:
print('d')
elif d <= 0:
print('0')

a,b = map(int,input().split())
c = 2*b
d = a-c
if a > c:
print(d)
else:
print(int(0))

a,b=map(int,input().split())
if a>2*b:
print(a-2*b)
else:
print(0)


a,b = map(int,input().split())
c = 2*b
d = a-c
if a > c:
print(d)
elif a <= c:
print(0)

a=int(input())
b=list(map(int,input().split()))
c=sum(b)
d=[(c-x)*x for x in b]
e=sum(d)
print(e/2)


a,b = map(int,input().split())
if a-2*b > 0:
 print(a-2*b)
else: 
 print(0)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a, b = map(int, input().split())
res = max(0, a - b*2)


a, b = map(int, input().split())
if a - a*b >= 0:
  print(a-2*b)
else:
  print("0")

a, b = map(int, input().split())
if a - a*b >= 0:
  print(a-2*b)
else
  print("0")

a, b = map(int, input().split())
res = max(0, a - b*2)
print(res)


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A, B = map(int, input().split())

if 2 * B < A:
  answer = 2 * B - A
  print(answer)
else:
  print(0)

A, B = map(int, input().split())

if 2 * B < A:
  answer = A - 2 * B
  print(answer)
else:
  print(0)


Verdicts: Wrong Answer

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a=int(input("enter a no"))
b=int(input("enter a no"))

if a>2b:
	print(a-2b)


else:
	print(0)


a=int(input("enter a no"))
b=int(input("enter a no"))

if a>2*b:
	print(a-2*b)


else:
	print(0)


a, b = [int(x) for x in input().split()]
ans = a - 2*b

if(ans < 0):
		ans=0

print(ans)		

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
import bisect
#input
n = int(input())
list1 = list(map(int,input().split()))
list1.sort()

cout = 0 

for i in range(n-2): 
	o = list1[i] 
	for j in range(i+1,n-1): 
		p = list1[j] 

		b = o+p -1 

		d = bisect.bisect_right(list1[j+1:],b) 
		
		cout += d

print(cout)

a,b = map(int,input().split())
if a <= b*2:
    print(0)
else:
    print(a-b*2)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A,B=map(int,input().split())
print(min(A-2*B),0)

A,B=map(int,input().split())
print(max(A-2*B,0))

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a=int(input())
b=int (input())
if(a-2*b>0):
    print(a-2*b)
else:
    print(0)

a,b=map(int,input().split())
if(a-2*b>0):
    print(a-2*b)
else:
    print(0)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A, B = int(input())

if A - B*2 <= 0:
  print(0)
else:
  print(A - B*2)

A, B = map(int, input())
C = A - B*2

if C >= 0:
  print(C)
else:
  print(0)

A, B = map(int, input().split())
C = A - B*2

if C >= 0:
  print(C)
else:
  print(0)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
data = input()
if data.split(' ')[0] > data.split(' ')[1]*2:
	print(0)
else:
  print(int(data.split(' ')[0]-data.split(' ')[1]*2)

import itertools
num = int(input())
cmlist = input().split(' ')
count = 0
for i,j,k in itertools.combinations(cmlist, 3):
  if int(i)<int(j)+int(k) and int(j)<int(i)+int(k) and int(k)<int(i)+int(j):
    count+=1
print(count)

data = input()
print(max(int(data.split(' ')[0])-int(data.split(' ')[1])*2,0))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
N=int(input())
d = list(map(int, input().split()))
total=0
for n in range(N):
    for j in range(n+1,N):
        total+=d[n]*d[j]
total

A=int(input())
B=int(input())
if A>2*B:
    print(A-2*B)
else:
    print(0)

A, B = map(int,input().split())
if A>2*B:
    print(A-2*B)
else:
    print(0)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a1=input()
a2=[i for i in a1.split()]
a3,a4=[res[i] for i in (0,1)]
A,B=int(a3),int(a4)
if A>2*B:
    print(A-(2*B))
elif A<2*B:
    print('0')

a1=input()
a2=[i for i in a1.split()]
a3,a4=[a2[i] for i in (0,1)]
A,B=int(a3),int(a4)
print(max(0,A-2*B))

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
import sys
input = sys.stdin.readline

N = int(input())
N = N-1
S = input()
s = ' '
o = ' '
n = 0
for i in range(N):
  if S[n] == S[n+1]:
    if s[-1] != S[n]:
      s = s + S[n]
    n = n + 1
  else:
    if s == o:
      s = s + S[n]
      s = s.lstrip()
    s = s + S[n+1]
    n = n + 1
print(len(s.lstrip()))

import sys
input = sys.stdin.readline

A,B = map(int,input().split())

C = B * 2

if A<C:
  print(0)
else:
  D = A - C
  print(D)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
N = int(input())
l = map(int,input().split())
l = sorted(l)
l_dict = dict()
max_l  = max(l)
min_l = min(l)
t_list = [one for one in l if one+min_l < max_l]
for i,one in enumerate(t_list):
    l_dict[one] = i
    
    
big_dict = dict()
for one in t_list:
    big_dict[one] = bisect.bisect_left(l,2*one)

counter = 0

for a,b in combinations(t_list,2):
    tmp = a + b
    counter += bisect.bisect_left(l[l_dict[b]+1:big_dict[b]],tmp)
    
print(counter)

A,B = map(int,input().split())
ans = A - B*2
if ans < 0 :
    print(0)
else:
    print(ans)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a,b = map(int, input().split())
ans = a - b + b
if ans <= 0:
  print(0)
else:
  print(ans)

a,b = map(int, input().split())
ans = a - b - b
if ans <= 0:
  print(0)
else:
  print(ans)

Verdicts: Wrong Answer

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a, b = map(int, input().split())
print(max(0, a - 2 * b)

a, b = map(int, input().split())
print(max(0, a - 2 * b))

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A,B = map(int, input().sprit())
C = A - B * 2
if C<0:
  print(0)  
else:
  print(C)

A,B = map(int, input().sprit())
C = A - B * 2
if C<0:
  print(0)  
else:
  print(C)

A,B = map(int, input().split())
C = A - B * 2
if C<0:
  print(0)  
else:
  print(C)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a,b=map(int,input().split())
if a>9 or b>9:
    print(-1)
else:
    print(a*b)

a,b=map(int,input().split())
if a<b*2:
    print(0)
else:
    print(a-b*2)

Verdicts: Wrong Answer

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a, b = map(int, input())


print(min( 0, a - 2 * b ))
  

a, b = map( int, input())

print( max( 0, a - 2 * b ))


a, b = map( int, input().split())
print( max( 0, a - b * 2 ))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A, B = map(int, input())
if A <= 2*B:
  print(0)
else:
  print(A - 2*B)

A, B = map(int, input().split())
if A <= 2*B:
  print(0)
else:
  print(A - 2*B)


Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A, B = map(int, input().split())

if A <= 2 * B:
  print(0)
  
else:
  print(2*B - A)

A, B = map(int, input().split())

if A <= 2 * B:
  print(0)
  
else:
  print(A - 2*B)

Verdicts: Wrong Answer

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A. B = map(int,input().split())
if A <= B*2:
    print(0)
else:
    print(A-2*B)

A, B = map(int,input().split())
if A <= B*2:
    print(0)
else:
    print(A-2*B)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A, B=map(int, input().split())
ans=a-2*b if a-2*b>0 else 0
print(ans)

a, b=map(int, input().split())
ans=a-2*b if a-2*b>0 else 0
print(ans)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a, b = input().split()
a = int(a)
b = int(b)

if b * 2 >= a:
  	print(0)
else:
  	s = a - b * 2  
    print(s)

a, b = input().split()
a = int(a)
b = int(b)
 
ans = max(a-b*2, 0)
print(ans)


Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
N = int(input())
S = input()
for i in range(N-1):
    if S[i] == S[i+1]:
        i += 1
        N -= 1
print(N)

A, B = map(int, input().split())
if A - 2*B >= 0:
    print(A - 2*B)
else:
    print(0)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
 a, b = map(int, input().split())
def curtain(a,b):
    if a <= b*2:
        return 0
    else:
        return a - b * 2
print(curtain(a,b))

a, b = map(int, input().split())
def curtain(a,b):
    if a <= b*2:
        return 0
    else:
        return a - b * 2
print(curtain(a,b))

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a = input()
a = a.split()
b = a[0] - 2*a[1]
if b >= 0:
  print(b)
else:
  print(0)

import itertools
N = input()
S = input()

count = 0

gr = itertools.groupby(S)
for key, group in gr:
    # print(list(group))
    count += 1
print(count)


a = map(int, input().split())
b = a[0] - 2*a[1]
if b >= 0:
  print(b)
else:
  print(0)


a = list(map(int, input().split()))
b = a[0] - 2*a[1]
if b >= 0:
  print(b)
else:
  print(0)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A,B = map(int,input())
if A-(2*B) > 0:
  print(A-(2*B))
else:
  print(0)

A,B = map(int,input().split())
if A-(2*B) > 0:
  print(A-(2*B))
else:
  print(0)


Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a,b=input().split()
if b*2 >= a:
  print(0)
else:
  print(a-b*2)

a,b=map(int, input().split())
if b*2 >= a:
  print(0)
else:
  print(a-b*2)


Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A,B=map(int,input().split())
if A>(2*B):
    print(A-(2*B)
else:
    print(0)

A,B=map(int,input().split())
if A>(2*B):
    print(A-(2*B))
else:
    print(0)


Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
input()
a,b=map(int,input().split())
print(int(max(0,a-2*b)))

gomi=input()
tako=[int(i) for i in input().split()]
print(int((sum(tako)**2-sum([i**2 for i in tako]))/2))  

a,b = map(int,input().split())
print(max(0,a-2*b))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
A,B=map(int,input().split())
if A<=2*B:
  print(0)
else A>2*B
  print(A-(2*B))

A,B=map(int,input().split())
if A<=2*B:
  print(0)
else A>2*B:
  print(A-(2*B))

A,B=map(int,input().split())
if A<=2*B:
  print(0)
else :
  print(A-(2*B))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
N=int(input())
S=input()
count=0
for i in range(N-1):
    if S[i]!=S[i+1]:
        count+=1
if N!=1 and S[N-2]!=S[N-1]:
    count+=1
if count==0:
    count+=1
print(count)


n=input().split(" ")
A=int(n[0])
B=int(n[1])
print(A-B*2 if A-B*2>=0  else 0)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a,b=map(int,input().split())
B=b*2
if a<B:
  print(a-B)
else:
  print('0')

a,b=map(int,input().split())
B=b*2
if a>B:
  print(a-B)
else:
  print('0')

Verdicts: Wrong Answer

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a, b = map(int, input())

if a - 2*b >= 0:
  print(a - 2*b)
else:
  print(0)

a, b = map(int, input().split())

if a - 2*b >= 0:
  print(a - 2*b)
else:
  print(0)

Verdicts: Runtime Error

Accepted
Problem: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)  We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Submission attempts (in order):
a, b = map(int, input().split())
print(a - (2 * b) if a > 2b else 0)

a, b = map(int, input().split())
print(a - (2 * b) if a > (2 * b) else 0)

Verdicts: Runtime Error

Accepted