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: Accepted

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

print(max(0,A - (2*B)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

print(max(ans,0))

Submission status: Accepted

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

Submission status: Accepted

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

print (max(0,A - B * 2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a, b = [int(i) for i in sys.stdin.readline().split()]
print(max(0, a-b*2))

Submission status: Accepted

Solution code:
# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()

# int(input())
# map(int, input().split())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(x) for x in input().split()]
print(max(0,A-B-B))

Submission status: Accepted

Solution code:
import sys
def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

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

Submission status: Accepted

Solution code:
#    !/usr/bin/env python3
#    encoding: UTF-8
#    Last Modified: 19/Oct/2019 05:30:55 PM


#    ✪ H4WK3yE乡
#    Mohd. Farhan Tahir
#    Indian Institute Of Information Technology (IIIT), Gwalior


import sys
import os
from io import IOBase, BytesIO


def main():
    a, b = get_ints()
    print(max(0, a - 2 * b))


BUFSIZE = 8192


class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill():
            pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill()
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        py2 = round(0.5)
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2 == 1:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode("ascii"))
            self.read = lambda: self.buffer.read().decode("ascii")
            self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)


def get_array():
    return list(map(int, sys.stdin.readline().split()))


def get_ints():
    return map(int, sys.stdin.readline().split())


def input():
    return sys.stdin.readline().strip()


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)

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

Submission status: Accepted

Solution code:
from fractions import gcd
from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
import sys
from bisect import *
import itertools
import copy
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7


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


    
            
    

    

    

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(A: int, B: int):
    print(max(A-2*B, 0))
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(max(A - 2 * B, 0))

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    a, b = list(map(int, input().rstrip('\n').split()))
    print(max(a - b * 2, 0))


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

print(max(0, (A - 2 * B)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=[int(i) for i in input().split()]
print(max(0, a-2*b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

A,B = II()
print(max(0,A-2*B))

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))

def main():
    a, b = na()

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

main()

Submission status: Accepted

Solution code:
import sys
from heapq import heappop, heappush
from operator import itemgetter
from collections import deque, defaultdict, Counter
from bisect import bisect_left, bisect_right
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10**9 + 7
INF = float('inf')

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


sol()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# input=lambda :sys.stdin.readline().rstrip()
def resolve():
    a,b=map(int,input().split())
    print(max(0,a-2*b))
resolve()

Submission status: Accepted

Solution code:

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

Submission status: Runtime Error

Solution code:
import sys
stdin=sys.stdin

ip=lambda: int(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()

a,b=ip()

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

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())
 
print(max([0, A - 2 * B]))

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
L= list(map(int,input().split()))
L_sorted=sorted(L,reverse=False)#昇順
count=0
for i in range(N):
    for j in range(i+1,N):
        a=L_sorted[i]
        b=L_sorted[j]
        n=a+b
        fin=N
        sta=0
        while sta+1<fin:
            m=((fin-sta)//2)+sta
            if L_sorted[m]<n:
                sta=m       
            else:
                fin=m   
        count+=sta-j
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
tmp = input().split(" ")
A = int(tmp[0])
B = int(tmp[1])

import math
print(math.max(A - 2 * B, 0))

Submission status: Runtime Error

Solution code:
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
import math
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math as M
MOD=10**9+7
import sys
#####################################
a,b=INPUT()
if a>=2*b:
    print(a-2b)
else:
    print(0)

Submission status: Runtime Error

Solution code:
a, b = [int(i) for i in input().split()]
print(max(0, a - 2 * b)

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(0, a-2b))

Submission status: Runtime Error

Solution code:
a,b=input().split()
c=b+b
if(a-b!=0):
    print(int(a-b))
else:
    print(0)

Submission status: Runtime Error

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

using ll = long long;
const int INF = 1e9+7;

void solve(){
	int a,b;cin >> a >> b;
	if(2*b >= a) cout << 0 << '\n';
	else cout << a-(2*b) << '\n';
}

int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	int t=1;
//	int t;cin >> t;
	while(t--) solve();
}

Submission status: Runtime Error

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

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())
print(max(0, A-B*2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

len_ = A-*B

if len_<=0:
    print(0)
else:
    print(len_)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n= int(input())
s = input()
ans = 1
for i in range(n-1):
    if s[i]==s[i+1]:
        continue
    else:
        ans += 1

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import itertools


def actual(n, D):
    """
    combinations でゴリ押し
    """
    comb = itertools.combinations(D, 2)

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

    """
    「順番を考慮しない2要素の選び方」を全探索する際のポイント
        内側のループ変数の始点を外側のループ変数 +1 から始めるとよい。
        これにより、内側のループで選ぶインデックスが必ず外側のループで選ぶインデックスより大きくなり、
        同じ選び方を 2 回見てしまうことを回避できます。
    """
    # s = 0
    # for i in range(len(D)):
    #     for j in range(i + 1, len(D)):
    #         s += D[i] * D[j]
    #
    # return s

    """
    O(N)で解くパターン
    
    ex: a, b, c, d
        a*b + a*c + a*d = a * (b + c +d)
              b*c + b*d = b * (    c +d)
                    c*d = c * (       d)
    """
    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))

Submission status: Runtime Error

Solution code:
import itertools


def actual(n, D):
    """
    combinations でゴリ押し
    """
    comb = itertools.combinations(D, 2)

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

    """
    「順番を考慮しない2要素の選び方」を全探索する際のポイント
        内側のループ変数の始点を外側のループ変数 +1 から始めるとよい。
        これにより、内側のループで選ぶインデックスが必ず外側のループで選ぶインデックスより大きくなり、
        同じ選び方を 2 回見てしまうことを回避できます。
    """
    # s = 0
    # for i in range(len(D)):
    #     for j in range(i + 1, len(D)):
    #         s += D[i] * D[j]
    #
    # return s

    """
    O(N)で解くパターン
    
    ex: a, b, c, d
        a*b + a*c + a*d = a * (b + c +d)
              b*c + b*d = b * (    c +d)
                    c*d = c * (       d)
    """
    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))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

##### 割り算の切り上げ #####
# tmp = -(-4 // 3)

##### dict の for文 #####
# for k, v in d.items():
#     print(k, v)

##### 進数の変換 #####
# bin_str = bin(i)[2:]
# oct_str = oct(i)[2:]
# hex_str = hex(i)[2:]

##### とても大きな数 と 小数の計算誤差 #####
# 「Decimal」は計算誤差を 0にできる。必要に応じて粒度を設定せよ。
# getcontext().prec = 100
#
# tmp = Decimal(i)
# A,B = map(Decimal, input().split())
# ans = A * B

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	A,B = inputMap()

	print(max(0,A-B*2)



#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# 2分検索のリバース
def bisect_left_reverse(a, x):
    if a[0] <= x:
        return 0
    if x < a[-1]:
        return len(a)
    # 二分探索
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] <= x:
            ok = mid
        else:
            ng = mid
    return ok

def bisect_right_reverse(a, x):
    if a[0] < x:
        return 0
    if x <= a[-1]:
        return len(a)
    # 二分探索
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] < x:
            ok = mid
        else:
            ng = mid
    return ok

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# 2分検索
# 存在しない場合: None 存在する場合: その値
def binary_search(list, item):
    low = 0
    high = len(list) - 1

    while low <= high:
        mid = (low + high) //2
        guess = list[mid]
        if guess == item:
            return mid
        if guess > item:
            high = mid -1
        else:
            low = mid + 1
    return None

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# N 個のボールを K グループに分ける場合のパターン数
def sunuke(N, K, mod=10**9+7):
	if N < K or K-1 < 0:
		return 0
	else:
		return combination(N-1, K-1, mod)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# dfs のサンプル
def dfs(graph,parent,counter,edge):
    stk = []
    stk.append(edge)
    while len(stk) > 0:
        p = stk.pop()
        for e in graph[p]:
            if parent[p] == e:
                continue
            else:
                parent[e] = p
                counter[e] += counter[p]
                stk.append(e)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
t=s[0]
ans=1
for i in range(1,n):
    if t!=s[i]:
        ans+=1
        t=s[i]
print(ans)

Submission status: Runtime Error

Solution code:
import sys
import bisect

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() # input string
ni = lambda: int(readline().rstrip()) # input int
nm = lambda: map(int, readline().split()) # input multiple int 
nl = lambda: list(map(int, readline().split())) # input multiple int to list

n = ni()
l = sorted(nm())

ans = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        a = l[i]
        b = l[j]
        idx = bisect.bisect_left(l, a + b)
        if idx > j: ans += idx - j - 1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().split()))
L = sorted(L, reverse=True)
count = 0
for i in range(0,N-2):
	for j in range(i+1,N-1):
		value = L[i] - L[j]
		if L[j+1] <= value:
			num = 0
		elif L[N-1] > value:
			num = N-j-1
		else:
			start = j+1
			end = N-1
			while start <= end:
				k = (end + start) // 2
				if L[k] > value and L[k+1] <= value:
					num = k-j
					break
				if L[k+1] > value:
					start = k + 1
				if L[k] <= value:
					end = k - 1
		count += num
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().split()))
L = sorted(L, reverse=True)
count = 0
for i in range(0,N-2):
	for j in range(i+1,N-1):
		value = L[i] - L[j]
		if L[j+1] <= value:
			num = 0
		elif L[N-1] > value:
			num = N-j-1
		else:
			start = j+1
			end = N-1
			while start <= end:
				k = (end - start) // 2
				if L[k] > value and L[k+1] <= value:
					num = k-j
					break
				if L[k+1] > value:
					start = k + 1
				if L[k] <= value:
					end = k - 1
		count += num
print(count)

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:
n = int(input())
ln = list(map(int, input().split()))

ln.sort()

def binary_search(x, r):
    left = r + 1
    right = n - 1
    while left < right:
        mid = (left + right) // 2
        if ln[mid] == x:
            return mid
        elif ln[mid] > x:
            right = mid - 1
        else:
            left = mid + 1
    mid = (left + right) // 2
    if ln[mid] > x:
        return mid - 1
    else:
        return mid


ans = 0
for a in range(n-2):
    for b  in range(a+1, n-1):
        cmax = ln[b] + ln[a] - 1
        ans += max(0, binary_search(cmax, b) - b)

print(ans)

Submission status: Runtime Error

Solution code:
def warshall_floid(d):
    for k in range(1,n+1):
        for i in range(1,n+1):
            for j in range(1,n+1):
                d[i][j] = min(d[i][j],d[i][k]+d[k][j])
    return d

n,m,l = map(int,input().split())
d = [10**13]*(n+1) for i in range(n+1)]
for i in range(m):
    a,b,c = map(int,input().split())
    d[a][b] = c
    d[b][a] = c
for i in range(1,n+1):
    d[i][i] = 0
d = warshall_floid(d)
for i in range(1,n+1):
    for j in range(1,n+1):
        if d[i][j] <= l:
            d[i][j] = 1
        else:
            d[i][j] = 10**13
d = warshall_floid(d)
q = int(input())
for i in range(q):
    s,t = map(int,input().split())
    if d[s][t] >= 10**13:
        print(-1)
    else:
        print(d[s][t]-1)

Submission status: Runtime Error

Solution code:
import sys

def wf(d):
  for i in range(n):
    for j in range(n):#start
      for k in range(n):#end
        d[j][k]=min(d[j][k], d[j][i] + d[i][k])
  return d

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

d=[[sys.maxsize]*(n) for _ in range(n)]
e=[[sys.maxsize]*(n) for _ in range(n)]
for i in range(n):
  d[i][i] = 0
  e[i][i] = 0

for _ in range(m):
  a,b,c = map(int, input().split())
  d[a-1][b-1]=c
  d[b-1][a-1]=c

d=wf(d)
for i in range(n):
  for j in range(n):
    if d[i][j] <= l:
      e[i][j] = 1

e=wf(e)

q=int(input())
for _ in range(q):
  s,t = map(int, input().split())
  if e[s-1][t-1] == sys.maxsize:
    print(-1)
  else:
    print(e[s-1][t-1]-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

A,B = str(inputIL())

print(max(0,A-2*B))

Submission status: Runtime Error

Solution code:
import itertools
n = int(input())
d = list(map(int, input().split()))
a = 0
for x in itertools.combinations(d, 2):
    a += x[0]*x[1]
print(a)

Submission status: Runtime Error

Solution code:
    w,c = map(int,input().split())
     
    res = w - (c+c)
    if res < 0:
      res =0
    print(res)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B = int(input())
L = A-2*B

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

m=a-2b

Submission status: Runtime Error

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

m=a-2b

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x, y = int(input().split())
if x - 2*y >= 0:
  print(x-2*y)
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:
print(max(0,a-b*2))

Submission status: Runtime Error

Solution code:
N,M=map(int,input90.split())
print(max(0,N-2*M))

Submission status: Runtime Error

Solution code:
from itertools import groupby
N=int(input())
print(len(list(groupby(input()))))

Submission status: Runtime Error

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

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

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:
import sys
input = sys.stdin.readline
n=int(input())
l = sorted(list(map(int, input().split())))
ans=0
for i in range(n):
  for k in range(i+1,n):
    for _ in range(k+1,n):
      if -l[i]+l[k]>=l[_]:
        continue
      elif l[i]+l[k]<=l[_]:
        break
      else:
        ans+=1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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