Problem:


Score : 100 points

Problem Statement

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.

Constraints

1 \leq A \leq 100

1 \leq B \leq 100

A and B are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

Print the total horizontal length of the uncovered parts of the window.

Sample Input 1

12 4

Sample Output 1

4

We have a window with a horizontal length of 12, and two curtains, each of length 4, that cover both ends of the window, for example. The uncovered part has a horizontal length of 4.

Sample Input 2

20 15

Sample Output 2

0

If the window is completely covered, print 0.

Sample Input 3

20 30

Sample Output 3

0

Each curtain may be longer than the window.



Sample input:
12 4


Sample output:
4

Submission status: Runtime Error

Solution code:
### D - Triangles ###

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

# N = 7
# L = [218, 786, 704, 233, 645, 728, 389]

from itertools import combinations

cb = list(combinations(L, 3))

my_lambda = lambda x : x[0] + x[1] > x[2] and x[1] + x[2] > x[0] and x[0] + x[2] > x[1]

print(sum(
        list(
            map(my_lambda, cb)
        )
    )
)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = input().split()
 
a = x[0]
b = x[1]
 
if a > b * 2:
  print(a - b * 2)
else:
  print(0)

Submission status: Runtime Error

Solution code:
x = input().split()

a = x[0]
b = x[1]

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

Submission status: Runtime Error

Solution code:
a, b = input().split()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
 
ans = max([a - 2*b, 0])
 
	
for num in range(100000000):

print(ans)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

ans = max(a - 2*b, 0)

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
cnt = 1
for i in range(1,N):
  if S[i-1] != S[i]:
    cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
cnt = 0
for i in range(1,N):
  if S[i-1] != S[i]:
    cnt += 1

print(cnt+1)

Submission status: Runtime Error

Solution code:
A = input(str())
B = input(str())
if A >= 2B:
  print(A - 2B)
else:
  print(0)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
deliciaus = list(map(int , input().split()))

heal = 0

for i in range(N):
    for j in range(i+1 , N):
        heal += deliciaus[i] * deliciaus[j]
    
print(heal)

Submission status: Runtime Error

Solution code:
n =int(input())
nl = list(map(int,input().split()))
result = 0
for i in range(n):
    for k in range(i+1,n):
        result += nl[i] * nl[k]
        
print(result)

Submission status: Runtime Error

Solution code:
n=input()
if n[0]-2*n[1]<0:
  print(0)
else:
  print(n[0]-2*n[1])

Submission status: Runtime Error

Solution code:
s=list(map(int,input().split()))
if s[1]-2*s[2]<0:
  print(0)
else:
  print(s[1]-2*s[2])

Submission status: Runtime Error

Solution code:
s=input().split()
if s[1]-2*s[2]<0:
  print(0)
else:
  print(s[1]-2*s[2])

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int, input().split()))
L.sort(reverse=True)
counter = 0
for i1 in range(len(L)-2):
    for i2 in range((i1+1),(len(L)-1)):
        for i3 in range((i2+1),len(L)):
            if L[i1] < L[i2]+L[i3]:
                counter += 1
print(counter)

Submission status: Runtime Error

Solution code:
A, B = [int(i) for i in input().split())]
ret = A - B*2
print(ret if ret > 0 else 0)

Submission status: Runtime Error

Solution code:
import bisect

N = int(input())
L = list(map(int, input().split()))
L = sorted(L)
ans = 0
for i in range(N):
  for j in range(i+1, N):
    min_sum = L[i]+L[j]
    more_than = bisect.bisect_left(L[j+1:], min_sum)
    ans += more_than
print(ans)

Submission status: Runtime Error

Solution code:
import bisect
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
 
 
def solve2():
    N = int(input())
    L = list(map(int, input().split()))
    L = sorted(L)
    ans = 0
    for i in range(N):
        for j in range(i+1, N):
            min_sum = L[i]+L[j]
            more_than = bisect.bisect_left(L[j+1:], min_sum)
            ans += more_than
    print(ans)
 
 
solve2()

Submission status: Runtime Error

Solution code:
A, B = list(map(int, input().split()))
if A<2*B:
  print(O)
else:
  print(A-2*B)

Submission status: Runtime Error

Solution code:
A, B = map(int,input().split())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import itertools
N = input()
S = input()

count = 0

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input()
b = input()
c = 2*b
if a>c:
  print(a-c)
elif a<c:
  print(0)

Submission status: Runtime Error

Solution code:
A = int(input('横方向の窓の長さ'))
B = int(input('横方向のカーテンの長さ'))

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=int (input())
if(a-2*b>0):
    print(a-2*b)
else:
    print(0)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
b=int(input())
ans =max(a-b*2,0)
print(ans)

Submission status: Runtime Error

Solution code:
a = int(input())
b=int(input())
if a <b:
  print(a)
else:
  print(a-b)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
if 2*b>=a:
    print("0")
else:
    print(a-2*b)

Submission status: Runtime Error

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

ans_set = set()

def is_triangle(a, b, c):
    if a < b + c and b < c + a and c < a + b:
        return True
    return False

for i in range(len(l)):
    for j in range(len(l)):
        for k in range(len(l)):
            if i == j or j == k or k == i:
                continue
            if is_triangle(l[i], l[j], l[k]):
                ans_set.add(frozenset([i, j, k]))

print(len(ans_set))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b = map(int. input().split())

if a>b:
    print(a-b)
elif a<b:
    print(0)

Submission status: Runtime Error

Solution code:
a,b = map(int. input().split())

if a>b:
    print(a-b)
elif a<b:
    print(0)
else:
    print(0)

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
  	A, B = map(int,input().split())
    result = A - B * 2
    if result <= 0:
      print(0)
    else:
      print(result)

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
  	A, B = map(int,input().split())
    result = A - B * 2
    if rsult <= 0:
      print(0)
    else:
      print(result)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = input().split()
print(min(0, a - b * 2))

Submission status: Runtime Error

Solution code:
# https://atcoder.jp/contests/abc143/tasks/abc143_a
# -*- coding: utf-8 -*-

stu_bangou = list(map(int, input().strip().split()))

print(stu_bangou[0] - (stu_bangou[1] * 2))# https://atcoder.jp/contests/abc143/tasks/abc143_a
# -*- coding: utf-8 -*-

stu_bangou = list(map(int, input().strip().split()))

if stu_bangou[0] < (stu_bangou[1] * 2):
    print(0)
else:
    print(stu_bangou[0] - (stu_bangou[1] * 2))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

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

answer=0

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

print(answer)

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import math

n,m,l = map(int,input().split())
adj = [[float('inf') for _ in range(n)] for _ in range(n)]
for _ in range(m):
    a,b,c = map(int,input().split())
    if c <= l:
        adj[a-1][b-1] = c
        adj[b-1][a-1] = c
    
import heapq

class Dijkstra(object):
    def dijkstra(self, adj, start):
        num = len(adj)          # グラフのノード数
        dist = [[float('inf'), float('inf')] for i in range(num)] # 始点から各頂点までの最短距離を格納する
        
        dist[start] = (0, 0)
        q = []                  # プライオリティキュー．各要素は，(startからある頂点vまでの仮の距離, 頂点vのID)からなるタプル
        heapq.heappush(q, (0, 0, start)) # 始点をpush

        while len(q) != 0:
            prov_cost, prov_fuel, src = heapq.heappop(q) # pop
            
            # 他の頂点の探索
            for dest in range(num):
                cost = adj[src][dest]
                if cost != float('inf'):
                    if prov_fuel + cost <= l:
                        new_cost = prov_cost
                        new_fuel = prov_fuel + cost
                    else:
                        new_cost = prov_cost + 1
                        new_fuel = cost
                    if dist[dest][0] > new_cost or (dist[dest][0] == new_cost and dist[dest][1] > new_fuel):
                        dist[dest] = (new_cost, new_fuel)
                        heapq.heappush(q, (new_cost, new_fuel, dest))
                        
        return dist



ans = []
for i in range(n):
    ans.append(Dijkstra().dijkstra(adj, i))
q = int(input())
for _ in range(q):
    s,t = map(int,input().split())
    if ans[s-1][t-1][0] == float('inf'):
        print(-1)
    else:
        print(ans[s-1][t-1][0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import fractions
import bisect
import math

mod=1000000007
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
A.sort(key=lambda x: x[1])


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

for i in range(N):
    A,B=map(int,input().split())
    B.append([A,B])

for i in reversed(range(N)):
print(B[i], end="")

B=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

math.ceil()   #切り上げ
math.floor()  #切り捨て

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

bisect.bisect_left(a,x)

Submission status: Runtime Error

Solution code:
a.b = int(input().split())

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

Submission status: Runtime Error

Solution code:
A,B =map(int.input().split())

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

Submission status: Runtime Error

Solution code:
A = int(input("please input A:"))
if A < 1 or A > 100 :
    print("0以上100以下で入力してください。\n")
    A = int(input("please input A:"))

B = int(input("please input B:"))
if B < 1 or B > 100 :
    print("0以上100以下で入力してください。\n")
    B = int(input("please input B:"))

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

Submission status: Runtime Error

Solution code:
lis = [ int(i) for i in input().split]
a = lis[0]
b = lis[1]
if b*2 > a:
  print(0)
else:
  print(a - b*2)

Submission status: Runtime Error

Solution code:
a, b = list(map(int, inout().split()));
ans = 0;
if a <= (b*2):
  ans = 0;
else:
  ans = a - (b*2);
  
print(ans);

Submission status: Runtime Error

Solution code:



N = int(input())

line = input()
#N = 3
#line = '2 1 2'
lines = line.split(' ')


dic = {}
for item in lines:
    n = int(item)

    if n in dic.keys():
        dic[n] += 1
    else:
        dic[n] = 1

lis = []
for item in dic.keys():
    lis += [dic[item]]


lis.sort(reverse=True)


sublis = []
sublis = lis[:]

def cal(k,lis):
    ans = 0
    if (len(lis)<k): return 0
    while True:
        for k_i in range(k):
            if lis[k_i] == 0:
                return ans
            else:
                lis[k_i] -= 1
        else:
            ans = ans + 1

        lis.sort(reverse=True)

    

for i in range(N):

    k = i + 1

    print(cal(k,lis))

Submission status: Runtime Error

Solution code:
import bisect

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

cnt = 0

for i in range(N - 2):
    for j in range(i + 1, N - 1):
        idx = bisect.bisect_left(L, L[i] + L[j], lo=j + 1)
        cnt += max(0, idx - (j + 1))
        
print(cnt)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split()))
d={i:l.count(i) for i in set(l)}
t=tuple(l.keys())
m=len(t)
T=0
for i in range(m-2):
  a=t[i]
  for j in range(m-i-1):
    b=t[i+j+1]
    for k in range(m-i-j-2):
      c=t[i+j+k+2]
      if a<b+c and b<c+a and c<a+b:
        T+=d{a}*d{b}*d{c}
print(T)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())

answer=a-2*B

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
a,b = [int(x) for x in N.split()]
c = a-2*b
d = c if c > 0 else 0
print d

Submission status: Runtime Error

Solution code:
n = int(input())
li =list(input().split())
a=0
for i in range(n-1):
  if li[i] == li[i+1]:
    a += 1
print(n-a)

Submission status: Runtime Error

Solution code:
n = int(input())
li =list(input().split())
for i in range(n-1):
  if li[i] == li[i+1]:
    li.remove(li[i])
print(len(li))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B=input().split()

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

Submission status: Runtime Error

Solution code:
n=int(input())
S=input()
s=list(S)
 

def jokyolist(s):
  jokyo=[]
  #jokyo配列はこれから除去すべき奴の番号のリスト
  for i in range(len(s)-1):
    if s[i]==s[i+1]:
      jokyo.append(i)
    jokyo=sorted(jokyo,reverse=True)
  return jokyo
 
def remov(s,jokyo):
  for i in range(len(jokyo)):
    s.pop(jokyo[i])
    return s
def removtimes(jokyo):
  t=len(jokyo)
  return t
 
i=0
while i<=n:
  jokyo=jokyolist(s)
  if removtimes(jokyo)==0:
    break
  s=remov(s,jokyo)
  i+=1

print(len(s))

Submission status: Runtime Error

Solution code:
    a = input()
    b = input()
    number_a = int(a)
    number_b = int(b)
    c = number_a - 2 * number_b
    if c <= 0:
        print(0)
    else:
        print(c)

Submission status: Runtime Error

Solution code:
a = input()
    b = input()
    number_a = int(a)
    number_b = int(b)
    c = number_a - 2 * number_b
    if c <= 0:
        print(0)
    else:
        print(c)

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
    a = input()
    b = input()
    number_a = int(a)
    number_b = int(b)
    c = number_a - 2 * number_b
    if c <= 0:
        print(0)
    else:
        print(c)

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
    a = input()
    b = input()
    c = a - 2 * b
    if c <= 0:
        print(0)
    else:
        print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
str = input()
char_list = list(str)
#del_num = []

count =0
ans =0

#dellist = lambda items, indexes: [item for index, item in enumerate(items) if index not in indexes]
for i in range(len(char_list)-1):
    if char_list[i] == char_list[i+1]:
        #del_num.append(i+1)
        count += 1

ans = n - count

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
str = input()
char_list = list(str)
del_num = []

dellist = lambda items, indexes: [item for index, item in enumerate(items) if index not in indexes]
ans =0
for i in range(len(char_list)-1):
    if char_list[i] == char_list[i+1]:
        del_num.append(i+1)

print(len(dellist(char_list,del_num)))

Submission status: Runtime Error

Solution code:
a,b = input().split()
a=int(a)
b=int(b)
temp=a-2b
if temp<=0:
  temp=0
print(temp)

Submission status: Runtime Error

Solution code:
res = A - 2 * B
if res <= 0: res = 0
print(res)

Submission status: Runtime Error

Solution code:
s = int(input())
s[0] = A
s[1] = B
result = A - B * 2
if result < 0:
    result = 0
print(result)

Submission status: Runtime Error

Solution code:
N, M, L = map(int,input().split())
MAX=999999999
A=[]
B=[]
C=[]
D=[[MAX for _ in range(N)] for _ in range(N)]
F=[[MAX for _ in range(N)] for _ in range(N)]
s=[]
t=[]
 
for i in range(M):
    l=list(map(int,input().split()))
    A.append(l[0]-1)
    B.append(l[1]-1)
    C.append(l[2])
 
 
 
Q=int(input())
 
for i in range(Q):
    m=list(map(int,input().split()))
    s.append(m[0]-1)
    t.append(m[1]-1)
 
 
for i in range(M):
    if C[i]>L : continue
    D[A[i]][B[i]]=C[i]
    D[B[i]][A[i]]=C[i]
 
for i in range(N):  D[i][i]=0
 
for k in range(N):
    for i in range(N):
        for j in range(N):
            if (D[i][k]+D[k][j])<D[i][j] :
                D[i][j]=D[i][k]+D[k][j]
 
for i in range(N):
    for j in range(N):
        if i==j : continue
        if D[i][j]<=L: F[i][j]=1
 
 
for i in range(N):  F[i][i]=0
 
for k in range(N):
    for i in range(N):
        for j in range(N):
            if (F[i][k]+F[k][j])<F[i][j] :
                F[i][j]=F[i][k]+F[k][j]
 
 
for p in range(Q) :
    if F[s[p]][t[p]] < MAX :
        print(F[s[p]][t[p]]-1)
    else :
        print(-1)

Submission status: Runtime Error

Solution code:
a, b = input().split()
a = int(a)
b = int(b)

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

Submission status: Runtime Error

Solution code:
N = int(input())
ns = input().split()

dic = {}

for i in range(N):
    if(ns[i] in dic.keys() and dic[ns[i]]<=2):
        dic[ns[i]] += 1
    elif(ns[i] not in dic.keys()):
        dic[ns[i]] = 1

a,b,c = 0,0,0
for key in dic.keys():
    if(dic[key] == 1):
        a += 1
    elif(dic[key] == 2):
        b += 1
    elif(dic[key] == 3):
        c += 1

unique = a+b+c
sum_ = 0

sum_ += c
sum_ += (b+c)*(unique-1)

key_list = list(dic.keys())
n = len(key_list)
for p in range(n-2):
    for q in range(n-1):
        if(p<q):
            for r in range(n):
                if(q<r):
                    x,y,z = int(key_list[p]),int(key_list[q]),int(key_list[r])
                    if(x+y>z):
                        sum_ += unique-(r+1-1)
                            break

print(int(sum_))

Submission status: Runtime Error

Solution code:
a,b = map(lambda x : int(x), input().split())
print(max(a - b * 2),0)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import bisect
n = int(input())
l = list(map(int, input().split()))
count = 0
l.sort()
for i in range(len(l)-1, 1, -1):
  for j in range(i-1, 0, -1):
    count += max(j - (bisect.bisect_right(l, l[i] - l[j])), 0)
print(count)

Submission status: Runtime Error

Solution code:
input(); d_list = list(map(int, input().split()))
sum=0
for i, x in enumerate(d_list):
  for y in d_list[i+1:]:
    sum+=x*y
print("%d" % sum)

Submission status: Runtime Error

Solution code:
a,b=int(input(),input())

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

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

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
import bisect
N = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0
for i in range(N):
  for j in range(i+1,N):
      add_len = L[i]+L[j]
      idx = bisect.bisect_left(L, add_len)
      ans += max(0, idx-(j+1))
print(ans)

Submission status: Runtime Error

Solution code:
w ,k = map(int, input().split())
x = w - (k*2)
if 0 <= x:
  print(x)
 else:
  print(0)

Submission status: Runtime Error

Solution code:
N = int(input())
ns = input().split()

sum_ = 0

for i in range(N):
    for j in range(N):
        sum_ += int(ns[i])*int(ns[j])
        
print(sum_)

Submission status: Runtime Error

Solution code:
a,b = input().split()
#a,b = int(a),int(b)
print(max(a-2*b,0))

Submission status: Runtime Error

Solution code:
a,b = input().split()
print(max(0,a-2*b))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b = (int(x) for x in input().split())
if(a>(b*2)):
  	print(a-(b*2))
else:
	print(0)

Submission status: Runtime Error

Solution code:
a,b = input().split()

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

Submission status: Runtime Error

Solution code:
try:
	a,b = input().split()
    if(a>(b*2)):
  		print(a-(b*2))
    else:
    	print(0)
except:
  print(0)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=input().split()

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

Submission status: Runtime Error

Solution code:
a, b = input()
c = b * 2
d = a - c
if d < 0:
	print(0)
else:
	print(d)

Submission status: Runtime Error

Solution code:
A=input()
B=input()
length = int(A) - 2 * int(B)
if length < 0:
    print(0)
else:
    print(length)

Submission status: Runtime Error

Solution code:
A = input('A=: ')
B = input('B=: ')

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

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
import bisect
n = int(input())
 
l = list(map(int, input().split()))
l.sort()
a = 0
print(l)
for i in range(n):
    for j in range(i+1,n):
        s = bisect.bisect_left(l,l[i]+l[j])-j-1
        a+=s


print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split(" "))
print(max(0a-*b))

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())

if a-2b>=0:
  print a-2b
else:
  print 0

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = input('A=: ')
B = input('B=: ')
if not((1<=int(A)<=100) and (1<=int(B)<=100)):
    print("1<=A,B<=100")
    A = input('A=: ')
    B = input('B=: ')

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

Submission status: Runtime Error

Solution code:
A = input('A=: ')
B = input('B=: ')
if not((1<=A<=100) && (1<=B<=100)):
    print("1<=A,B<=100")
    A = input('A=: ')
    B = input('B=: ')

Submission status: Runtime Error

Solution code:
A-2*B

Submission status: Runtime Error

Solution code:
A-2B

Submission status: Runtime Error

Solution code:
import numpy as np
N=int(raw_input())
AN=map(int, raw_input().split())
BN=[0 for i in xrange(N)]
for i in AN:
    BN[i-1] += 1
BN=[i for i in BN if i > 0]
BN.sort(reverse=True)

for K in xrange(1, N+1):
    x = np.zeros(K)
    for i in BN:
        x[x.argmin()] += i

    print (int(x.min()))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys


def main(window_len, cartain_len):
    ret = int(window_len) - int(cartain_len)*2
    if ret >= 0:
        return ret
    else:
        return 0


if __name__ == "__main__":
    args = sys.argv
    window_len = args[1]
    cartain_len = args[2]
    print(main(window_len, cartain_len))

Submission status: Runtime Error

Solution code:
import sys


def main():
    ret = window_len - cartain_len*2
    if ret >= 0:
        return ret
    else:
        return 0


if __name__ == "__main__":
    args = sys.argv
    window_len = args[1]
    cartain_len = args[2]
    main(window_len, cartain_len)

Submission status: Runtime Error

Solution code:
A,B = [int(c) for c in input().strip().split('')]
if 2*B>A:
  print(0)
else:
  print(A-2*B)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()

p = ''
result = 0
for i in range(N):
    if p != S[i]:
        result += 1
        p = S[i]
print(result)

Submission status: Runtime Error

Solution code:
N = int(input())
sticks = list(map(int, input().split()))

#N=len(sticks)
sticks.sort(reverse = True)
count = 0
fj = True
for i in range(0,N-2):
    for j in range(i+1,N-1):
        if not fj:
            fj=True
            break
        else:
            for k in range(j+1,N):
                #stick[i]>j>k
                if sticks[i]<sticks[j]+sticks[k]:
                    count += 1
                else:
                    if j+1 == k :
                        fj = False
                    break
        
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
L = list(map(int, input().split()))
tri = 0
ran = list(range(N-2))

for i in ran:
    for j in ran:
        for k in range(N-2-i-j):
            if ((L[i] + L[i+j+1]) > L[i+j+k+2]) and ((L[i] + L[i+j+k+2]) > L[i+j+1]) and ((L[i+j+k+2] + L[i+j+1]) > L[i]):
                tri += 1
print(tri)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input("enter a no"))
b=int(input("enter a no"))

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


else:
	print(0)

Submission status: Runtime Error

Solution code:
a=int(input("enter a no"))
b=int(input("enter a no"))

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


else:
	print(0)

Submission status: Runtime Error

Solution code:
a,b = map(int,intput().split())
ans = max(a-2*b,0)
print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
L=list(map(int,input().split()))
c=0
L.sort()
for i in range(0,N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if L[k]>=L[i]+L[j]:
                c+=N-k
                break
N=int((N-2)*(N-1)*N/6-c)
print(N)

Submission status: Runtime Error

Solution code:
x=input(A)
y=input(B)
x-=2*y
if x<=0:
  return(0)
else:
  return(x)

Submission status: Runtime Error

Solution code:
import fileinput

def process(A, B):
	if A <= B*2:
      return 0
    else:
      return A - B*2

for line in fileinput.input():
    print(process(map(int, line.split()))

Submission status: Runtime Error

Solution code:
import fileinput

def process(A, B):
	if A =< B*2:
      return 0
    else:
      return A - B*2

for line in fileinput.input():
    print(process(map(int, line.split()))