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:
a,b=map(int,input().split())

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

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

Solution code:
import bisect
N=int(input())
L=sorted(map(int,input().split()))
cnt=0
for i in range(N):
    for j in range(i):
        a=L[i]
        b=L[j]
        right=a+b
        left=abs(a-b)
        res=bisect.bisect_left(L,right)-bisect.bisect_right(L,left)
        if(left<a<right):
            res-=1
        if(left<b<right):
            res-=1
        cnt+=res
print(cnt//3)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

remain = max(0, A - B * 2)

print(remain)

Submission status: Runtime Error

Solution code:
mod = 10 ** 9 + 7
mod2 = 2**61+1
from collections import deque
import heapq
from bisect import bisect_left, insort_left, bisect_right

def iip(listed=True):
    ret = [int(i) for i in input().split()]
    if len(ret) == 1 and not listed:
        return ret[0]
    return ret

def iip_ord():
    return [ord(i) - ord("a") for i in input()]


def main():
    ans = solve()
    if ans is not None:
        print(ans)

def solve():
    N, M, L = iip()

    edge = {}
    for i in range(N):
        edge[i] = []

    for i in range(M):
        a, b, c = iip()
        a -= 1
        b -= 1
        if c <= L:
            edge[a].append(b+c*1000)
            edge[b].append(a+c*1000)

    dis_table = []
    for start_node in range(N):
        q = deque()
        q.append(start_node)

        dis = [10**12 for _ in range(N)]
        dis[start_node] = 0

        while q:
            data = q.popleft()
            cd = data // 1000
            cn = data % 1000
            if dis[cn] != cd: #更新済みの場合、スキップ
                continue
            nokori_nenryou = L - (cd % L)

            for root in edge[cn]:
                nd = root // 1000
                nn = root % 1000

                d_old = dis[nn]
                if nd > nokori_nenryou:
                    c_new = (cd // L + 1) * L + nd
                else:
                    c_new = cd + nd

                if c_new < d_old:
                    dis[nn] = c_new
                    q.append(nn + c_new*1000)
        dis_table.append(dis)

    q = iip(False)
    ans = []
    for i in range(q):
        a, b = iip()
        c = dis_table[a-1][b-1]

        if c == 10**12:
            ans.append(-1)
            continue
        else:
            ans.append((c-1) // L)

    split_print_enter(ans)


#####################################################ライブラリ集ここから

def split_print_space(s):
    print(" ".join([str(i) for i in s]))


def split_print_enter(s):
    print("\n".join([str(i) for i in s]))


def koenai_saidai_x_index(sorted_list, n):
    l = 0
    r = len(sorted_list)
    if len(sorted_list) == 0:
        return False
    if sorted_list[0] > n:
        return False

    while r - l > 1:
        x = (l + r) // 2
        if sorted_list[x] == n:
            return x
        elif sorted_list[x] > n:
            r = x
        else:
            l = x
    return l


def searchsorted(sorted_list, n, side):
    if side not in ["right", "left"]:
        raise Exception("sideはrightかleftで指定してください")

    l = 0
    r = len(sorted_list)

    if n > sorted_list[-1]:
        # print(sorted_list)
        return len(sorted_list)
    if n < sorted_list[0]:
        return 0

    while r - l > 1:
        x = (l + r) // 2
        if sorted_list[x] > n:
            r = x
        elif sorted_list[x] < n:
            l = x
        else:
            if side == "left":
                r = x
            elif side == "right":
                l = x

    if side == "left":
        if sorted_list[l] == n:
            return r - 1
        else:
            return r

    if side == "right":
        if sorted_list[l] == n:
            return l + 1
        else:
            return l


def soinsuu_bunkai(n):
    ret = []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            n //= i
            ret.append(i)
        if i > n:
            break
    if n != 1:
        ret.append(n)
    return ret


def conbination(n, r, mod, test=False):
    if n <= 0:
        return 0
    if r == 0:
        return 1
    if r < 0:
        return 0
    if r == 1:
        return n
    ret = 1
    for i in range(n - r + 1, n + 1):
        ret *= i
        ret = ret % mod

    bunbo = 1
    for i in range(1, r + 1):
        bunbo *= i
        bunbo = bunbo % mod

    ret = (ret * inv(bunbo, mod)) % mod
    if test:
        # print(f"{n}C{r} = {ret}")
        pass
    return ret


def inv(n, mod):
    return power(n, mod - 2)


def power(n, p, mod_= mod):
    if p == 0:
        return 1
    if p % 2 == 0:
        return (power(n, p // 2, mod_) ** 2) % mod_
    if p % 2 == 1:
        return (n * power(n, p - 1, mod_)) % mod_


if __name__ == "__main__":
    main()

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=int(input().split())
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(a-2*b)
else:
  print(0)

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:
a,b=map(int,input())
print(a-b*2 if (a-b*2>0) else 0)

Submission status: Runtime Error

Solution code:
# import numpy as np
import bisect

def main(ls):
    total = 0

    for i in range(len(ls) - 2):
        for j in range(i + 1, len(ls) - 1):
            a = ls[i]
            b = ls[j]
            ls2 = ls[j + 1:]
            if a + b == ls2[0]:
                 num = 0
            else:
                 # num = np.searchsorted(ls2, a + b, side='right')
                 num = bisect.bisect_right(ls2, a + b)
            total += num

    print(total)


_n = input()
ls = list(sorted(map(int, input().strip().split())))

main(ls)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B = list(map(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())
C = A - B*2

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

Submission status: Runtime Error

Solution code:
A, B = int(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include "bits/stdc++.h"

#define rep(i, a) for (int i = 0; i < (int)a; ++i)
#define REP(i, a, b) for (int i = (a); i < (int)b; ++i)

// [debug]

using namespace std;
using ll = long long;
using P = pair<int, int>;

void Main() {
  int a, b;
  cin >> a >> b;
  cout << max(0, a - 2 * b) << endl;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from bisect import bisect_left

n=int(input())
L=list(map(int,input().split()))
L=sorted(L)
ans=0
for i in range(n-2):
    a=L[i]
    for j in range(i+1,n-1):
        ans+=bisect_left(L,a+L[j])-j-1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
L = sorted(map(int,input().split()),reverse=True)
num = 0

for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            array = [L[i],L[j],L[k]]
            if(array[0]>=array[1]+array[2]):
                break
            else:
                num += 1
print(num)

Submission status: Runtime Error

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

ans = A-B*2

if(x>=0):
  print(ans)
else:
  print("0")

Submission status: Runtime Error

Solution code:
from sys import stdin
import bisect
        
N = int(stdin.readline().rstrip())
L = [int(x) for x in stdin.readline().rstrip().split()]
L.sort()
 
ans = 0
for a in range(len(L)-2):
    for b in range(a + 1, len(L)-1):
        c = bisect.bisect_left(L, L[a] + L[b])

        ans += c - 1 - b
print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin
import bisect
        
N = int(stdin.readline().rstrip())
L = [int(x) for x in stdin.readline().rstrip().split()]
L.sort()
 
ans = 0
for a in range(len(L)-2):
    for b in range(a + 1, len(L)-1):
        c = bisect.bisect_left(L, L[a] + L[b])

        	ans += c - 1 - b
print(ans)

Submission status: Runtime Error

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

ls.sort()

dis = 0
for i in range(0, n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            if ls[i] + ls[j] <= ls[k]: dis += 1

ans = (n*(n-1)*(n-2) // 6) - dis
print(ans)

Submission status: Runtime Error

Solution code:
input_line = input()
inputs = input_line.split(' ')
inputs = [int(input) for input in inputs]

A = inputs[0]
B = inputs[1]

dual_B = 2 * B

res = 0
if A > dual_b:
    res = A - dual_B
else: 
    res = 0

print(0)

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:
def o(a,b):
  if a>2*b:
    return a-2*b
  return 0
 
a=int(imput())
b=int(imput())
print(o(a,b))

Submission status: Runtime Error

Solution code:
def o(a,b):
  if a>2*b:
    return a-2*b
  return 0
 
a=imput()
b=imput()
print(o(a,b))

Submission status: Runtime Error

Solution code:
def o(a,b):
  if a>2*b:
    return a-2*b
  return 0

a=imput()
b=imput()
print(a,b)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
print(min(A-2*B),0)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

    # queries.append((a, b))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if a >= 2b:
    print(a-2*b)
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:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	A,B = MI()
	if(A <= B*2):
		print(0):
	else:
		print(A-2*B)

main()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

A = int(A)
B = int(B)

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

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-2B>=0:
  print(A-2B)
else:
  print(0)

Submission status: Runtime Error

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

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:
m=int(input());
n=int(input());
if(n>m):
  print("0")
elif((2*n)>=m):
  print("0")
else:
  print(m%(2*n))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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


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

Submission status: Runtime Error

Solution code:
n  = int(input())

if n % 2 == 0:
  print((n // 2) / n)
else:
  print((int(n / 2) + 1)  / n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

void solve()
{
}

int main()
{
    int a, b;

    cin >> a >> b;

    int ans = max(a - 2 * b, 0);
    cout << ans << endl;

    return 0;
}

Submission status: Runtime Error

Solution code:
A, B = map(int, input())
print(max(A - 2 * B, 0))

Submission status: Runtime Error

Solution code:
print(max(int(input()) - 2*int(input()), 0))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define rep(i, s, n) for (int i = s; i < (n); ++i)
using namespace std;

int main() {
  int a, b, ans;
  cin >> a >> b;
  ans = a - 2 * b;
  if (ans < 0) ans = 0;
  cout << ans << endl;
}

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int(),imput().split())
print(max(a*b,a-b,a+b))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
l=sorted([int(i) for i in input().split()],reverse=True)

#print(l)
co=0
for i in range(n-2):
    c=l[i]
    x=0
    for j in range(i+1,n-1):
        b=l[j]
        for k in range(j+1,n):
            a=l[k]
            if c<(a+b):
                co+=1
            else:
                x=1
                break
        if x==1:
            break

print(co)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

c = a - 2b

if c > 0:
  print(c)
  
else:
  print(0)

Submission status: Runtime Error

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

c = a - 2b

print(c if c > 0 else 0)

Submission status: Runtime Error

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

c = a - 2b

print(c if c > 0 else 0)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,l=(int,input().split())
if(n>2*l):
    print(n-2*l)
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:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=map(int(input().split()))

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

Submission status: Runtime Error

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

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

else:
  print(a - cover_b)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from functools import reduce
from operator import add

n = int(input())
l1 = [int(i) for i in input().split()]
print(reduce(add, [l1[a]*l1[b] for a in range(n-1) for b in range(a+1,n)]))

Submission status: Runtime Error

Solution code:
import bisect
n=int(input())
L=[]*n
L=list(map(int,input().split()))
L.sort()
cnt=0
for i in range(n-2):
    for j in range(i+1,n-1):
        ab=L[i]+L[j]
        num=bisect.bisect_left(L[j+1:],ab)
        cnt+=num
print(cnt)

Submission status: Runtime Error

Solution code:
def check(a, b, c):
    return (a < b+c) and (b < a+c) and (c < a+b)


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

l = sorted(l)

n = 0
for a in range(N-2):
    for b in range(a+1, N-1):
        for c in range(b+1, N):
            if (check(l[a], l[b], l[c])):
                n += 1
            else:
                continue
print(n)

Submission status: Runtime Error

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

i = 0
while i<len(s)-1:
  if s[i] == s[i+1]:
    del s[i]
  else:
    i += 1
print(len(s))

Submission status: Runtime Error

Solution code:
N = int(input(()))
L = list(map(int,input().split()))
count = 0

l = []
for j in range(N-1):
    for i in range(j+1,N):
        for k in range(i+1,N):
            if(L[i]+L[j]>L[k])and(L[i]+L[k]>L[j])and(L[i]<L[j]+L[k]):
                l.append([i,j,k])
                if [i,j,k] in l:
                    continue
                else:
                    count += 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input(()))
L = list(map(int,input().split()))
count = 0

l = []
for j in range(N-1):
    for i in range(j+1,N):
        for k in range(i+1,N):
            if(L[i]+L[j]>L[k])and(L[i]+L[k]>L[j])and(L[i]<L[j]+L[k]):
                l.append([i,j,k])
                if([i,j,k] in l):
                    count += 1
print(count)
print(l)

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

Solution code:
import itertools

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

print(sum(x*y for x, y in itertools.combinations(t, 2)))

Submission status: Runtime Error

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

if A<=cartain :
    input(0)
else :
    input(A-cartain)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstdio>
#include <bitset>
#include <complex>
#define ll long long
#define INF 1000000000000000001
#define MOD 1000000007
using namespace std;


int main(){
    int a,b;
    cin >> a >> b;
    cout<<max(a-2*b,0)<<endl;
    return 0;
    
}

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

count = 0

for i in range(N):
    for j in range(i+1,N):
        count += list_d[i]*list_d[j]

print(count)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N=int(input())
L=list(map(int,input().split()))
L.sort()
L.reverse()
count=0
a=len(L)
#print(L)
for i in range(a-2):
  count1=0
  for j in range(i+1,a-1):
    for k in range(j+1,a):
      if L[i]<L[j]+L[k]:
        count+=1
        #print(L[i],L[j],L[k])
      else:
        count1+=1
        break
    if count1==1:
         break
print(count)

Submission status: Runtime Error

Solution code:
N=int(input())
L=list(map(int,input().split()))
L.sort()
L.reverse()
count=0
a=len(L)
#print(L)
for i in range(a-2):
  count1=0
  for j in range(i+1,a-1):
    for k in range(j+1,a):
      if L[i]<L[j]+L[k]:
        count+=1
        #print(L[i],L[j],L[k])
      else:
        count1+=1
        break
    if count1==1:
         break
print(count)

Submission status: Runtime Error

Solution code:
N=int(input())
L=list(map(int,input().split()))
L.sort()
L.reverse()
count=0
count1=0
a=len(L)
#print(L)
for i in range(a-2):
  for j in range(i+1,a-1):
    for k in range(j+1,a):
      if L[i]<L[j]+L[k]:
        count+=1
        #print(L[i],L[j],L[k])
      else:
         break

print(count)

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:
A, B = map(int, input().split())
print(max(A- 2*b, 0))

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 > 2b:
  print(a-2b)
else:
  print(0)

Submission status: Runtime Error

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

#隠される範囲
C = (B*2)
D = A-C

if D = 0:
    print(0)
else:
    print(D)

Submission status: Runtime Error

Solution code:
A,B= map(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 = 2*a-b
if c >=0:
  print(c)
else:
  print(0)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

leng = int(sys.argv[1])
curtain = int(sys.argv[2])

care = leng - 2*curtain
if care < 0 :
	care = 0

print(care)

Submission status: Runtime Error

Solution code:
#Curtain.py

import sys

leng = int(sys.argv[1])
curtain = int(sys.argv[2])


care = leng - 2*curtain
if care < 0 :
	care = 0

print(care)

Submission status: Runtime Error

Solution code:
n = int(input())
l0 = [int(i) for i in input().split()]
l = sorted(l0, reverse = True)
ans = 0

for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            if l[i] < l[j] + l[k]:
                ans += 1
            else:
                break


print(ans)

Submission status: Runtime Error

Solution code:
n,m,l = map(int, input().split())
INF = 1001001001
dist = [[INF for i in range(n)] for i in range(n)]
#make graph
for i in range(n):
  dist[i][i] = 0
for i in range(m):
  a, b, c = map(int, input().split())
  dist[a-1][b-1] = dist[b-1][a-1] = c
#warshall-froyd
for k in range(n):
  for i in range(n):
    for j in range(n):
      dist[i][j] = min(dist[i][j], dist[i][k]+dist[k][j])
dist2 =  [[INF for i in range(n)] for i in range(n)]
for i in range(n):
  for j in range(n):
    if dist[i][j] <=l:
      dist2[i][j] = 1
#warshall-froyd
for k in range(n):
  for i in range(n):
    for j in range(n):
      dist2[i][j] = min(dist2[i][j], dist2[i][k]+dist2[k][j])
q = int(input())
for i in range(q):
  s,t = map(int, input().split())
  if dist2[s-1][t-1] == INF:
    print(-1)
  else:
    print(dist2[s-1][t-1]-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

try:
  print(a - (b*2))
else:
  print("0")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
if b * 2 >= a:
    print 0
else:
    print a - b *2

Submission status: Runtime Error

Solution code:
if b * 2 >= a:
  print 0
 else:
  print a - b *2

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())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input_lst = readline().split(' ')
cand = int(input_lst[1]) - 2 * int(input_lst[0])
print(max(0, cand))

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]

L.sort()

from itertools import combinations

cb = combinations(L, 2)
cb = list(map(sorted, cb))

rslt = 0

for el_cb in cb:
    for v in L:
        if el_cb[1] - el_cb[0] <= v and el_cb[0] >= v:
            rslt = rslt + 1

# if のところに2分探索入れる

print(rslt)

Submission status: Runtime Error

Solution code:
from multiprocessing import Pool

### D - Triangles ###
 
N = int(input())
L = list(map(int, input().split()))
 
from itertools import combinations
 
cb = combinations(L, 3)
 
def my_def(x):
    if x[1] + x[2] > x[0]:
        if x[0] + x[2] > x[1]:
            if x[0] + x[1] > x[2]:
                return(1)
    return(0)
 
print(sum(list(map(my_def, cb))))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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