Problem:


Score : 100 points

Problem Statement

Snuke has N integers: 1,2,\ldots,N.
He will choose K of them and give those to Takahashi.

How many ways are there to choose K consecutive integers?

Constraints

All values in input are integers.

1 \leq K \leq N \leq 50

Input

Input is given from Standard Input in the following format:

N K

Output

Print the answer.

Sample Input 1

3 2

Sample Output 1

2

There are two ways to choose two consecutive integers: (1,2) and (2,3).

Sample Input 2

13 3

Sample Output 2

11



Sample input:
3 2


Sample output:
2

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
n1 = 1
while n > 0:
    n1 *= n
    n -= 1
r = n - k
r1 = 1
while r > 0:
    r1 *= r
    r -= 1
k1 = 1
while k1 > 0:
    k1 *= k
    k -= 1
a = r1 * k1
print(n1//a)

Submission status: Runtime Error

Solution code:
n = int(input())
s = []
for i in range(0, n):
    s.append(input())

c = 0
a = 0
b = 0
ab = 0

for i in range(0, n):
    for j in range(1, len(s[i])):
        if s[i][j-1:j+1] == "AB":
            c += 1
    if s[i][-1] == "A" and s[i][0] == "B":
        ab += 1
    else: 
        if s[i][0] == "B":
            b += 1
        if s[i][-1] == "A":
            a += 1

s = c
s += min(a, b)
a -= min(a, b)
b -= min(a, b)

if(ab > 0):
    s += ab - 1
    if(a > 0):
        s += 1
    if(b > 0):
        s += 1

print(s)

Submission status: Runtime Error

Solution code:
import re
N=int(input())
listA=[input() for i in range(N)]

firstB=0
endA=0
feAB=0
AB=0
for i in listA:
    AB+=len(re.findall("AB",i))
    print(len(re.findall("AB",i)))
    if i[0]=="B":
        firstB+=1
    if i[-1]=="A":
        endA+=1
        if i[0]=="B":
            feAB+=1
AB+=min([endA,firstB])
print(AB)

Submission status: Runtime Error

Solution code:
N = int(input())
c = 0
tail_A = 0
head_B = 0
B_A = 0
def count(S):
    if len(S) == 1:
        return 0
    c = 0
    for i in range(len(S)-1):
        if S[i] == 'A' and S[i+1] == 'B':
            c += 1
    return c

for _ in range(N):
    s = input()
    c += count(s)
    if s[-1] == 'A':
        if s[0] == 'B':
            B_A += 1
        else:
            tail_A += 1
    else:
        if s[0] == 'B':
            head_B += 1

if tail_A > 0 and head_B > 0:
    c = c + B_A + 1
    tail_A -= 1
    head_B -= 1
elif tail_A == 0 and head_B > 0:
    c = c + B_A
    head_B -= 1
elif tail_A > 0 and head_B == 0:
    c = c + B_A
    tail_A -= 1
else:
    c = c + B_A - 1

c += min(tail_A, head_B)
print(c)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
n1 = 1
while n > 0:
    n1 *= n
    n -= 1
r = n - k
r1 = 1
while r > 0:
    r1 *= r
    r -= 1
k1 = 1
while k1 > 0:
    k1 *= k
    k -= 1
print(n1//(r1*k1))

Submission status: Runtime Error

Solution code:
n = int(input())
S = [input() for _ in range(n)]
cnt = 0
fb_cnt = 0
ba_cnt = 0
for s in S:
    idx = len(s) - 1
    for i in range(idx - 1):
        if s[i] == 'A' and s[i + 1] == 'B':
            cnt += 1
    if s[idx] == 'A':
        ba_cnt += 1
    if s[0] == 'B':
        fb_cnt += 1

min_cnt = min(fb_cnt, ba_cnt)
min_cnt = min_cnt - 1 if n <= min_cnt else min_cnt
print(cnt + min_cnt)

Submission status: Runtime Error

Solution code:
r,g,b,n=list(map(int,input().split()))
i,j,k=0,0,0
R,G,B=0,0,0
c=0
while R<n:
    R=r*i
    print(R)
    while G<=n-R:
        G=g*j
        print(G)
        B,k=0,0
        while B<=n-R-G:
            B=b*k
            print(B)
            if n-R-G-B==0:
                c+=1
            k+=1
        j+=1
    i+=1
    G,j=0,0
print(c)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# input
a = int(input())
s = 0
bc = 0
ac = 0
tc = 0
for i in range(a):
    t = input()
    s += t.count('AB')
    if t[:1] == 'B':
        bc += 1
    if t[-1:] == 'A':
        ac += 1
    if t[:1] == 'B' or t[-1:] == 'A':
        tc += 1
if min(bc, ac) == tc and tc > 0:
    o = s + min(bc, ac)-1
else:
    o = s + min(bc, ac)
print(o)

Submission status: Runtime Error

Solution code:
N = int(input())
s = [str(input()) for i in range(N)]
ans = 0
a = 0
b = 0
ab = 0
for i in range(N):
    ans += s[i].count('AB')
    if s[i][0] == 'B' and not s[i][-1] == 'A':
        b += 1
    if s[i][-1] == 'A' and not s[i][0] == 'B':
        a += 1
    if s[i][0] == 'B' and s[i][-1] == 'A':
        ab += 1
ans += min(a,b)
ans += ab
print(ans)

Submission status: Runtime Error

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

print(N+1-k)

Submission status: Runtime Error

Solution code:
N,K=map(int, input().split(" "))
ans = N - K + 1
input(ans)

Submission status: Runtime Error

Solution code:
def combinations(R, G, B, N):
    R, G, B, N = int(R), int(G), int(B), int(N)
    sorted_tuple = sorted((R, G, B), reverse=True)
    R = sorted_tuple[0]
    G = sorted_tuple[1]
    B = sorted_tuple[2]
    number_combos = 0
    print(R)
    print(G)
    print(B)
    for x in range(N + 1):
        N_modified_x = N - R * x
        for y in range(N_modified_x + 1):
            N_modified_y = N_modified_x - G * y
            for z in range(N_modified_y + 1):
                if B * z == N_modified_y:
                    number_combos += 1
    return number_combos

R, G, B, N = input().split(' ')
print(combinations(R, G, B, N))

Submission status: Runtime Error

Solution code:
r, g, b, n = map(int, input().split())

ans = 0

for x in range(n+1):
    for y in range(n+1):
        if r*x + g*y >n:
            break
        for z in range(n+1):
            w = r*x + g*y + b*z
            if w>n:
                break
            if w == n:
                ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
%%time
def combinations(R, G, B, N):
    R, G, B, N = int(R), int(G), int(B), int(N)
    sorted_tuple = sorted((R, G, B), reverse=True)
    R = sorted_tuple[0]
    G = sorted_tuple[1]
    B = sorted_tuple[2]
    number_combos = 0
    
    for x in range(N + 1):
        N_modified_x = N - R * x
        for y in range(N_modified_x + 1):
            N_modified_y = N_modified_x - G * y
            for z in range(N_modified_y + 1):
                if B * z == N_modified_y:
                    number_combos += 1
    return number_combos

R, G, B, N = input().split(' ')
print(combinations(R, G, B, N))

Submission status: Runtime Error

Solution code:
n = int(input())
S = [input() for i in range(n)]
cnt = 0
a = 0
b = 0
for i in range(n):
    cnt += S[i].count("AB")
    if S[i].startswith("B"):
        a += 1
    if S[i].endswith("A"):
        b += 1
if min(a, b) > n - 1:
    print(cnt + n - 1)
else:
    print(cnt + min(a, b))

Submission status: Runtime Error

Solution code:
# floor(N/m) = N % m

def divisors(n):
    D = []
    for d in range(1,int((n)**.5)+1):
        if n%d == 0:
            D.append(d)
            if n//d != d:
                D.append(n//d)
    return D

def solve(n):
    s = 0

    for d in divisors(n):
        m = d - 1
        if m and (m+1)*(n//m) == n:
            s += m
    return s


n = int(input())
print(solve(n))

Submission status: Runtime Error

Solution code:
N = int(input())
count = 0
tail_A = 0
head_B = 0
B_A = 0
for _ in range(N):
    s = input()
    count += s.count('AB')
    if s[-1] == 'A':
        if s[0] == 'B':
            B_A += 1
        else:
            tail_A += 1
    else:
        if s[0] == 'B':
            head_B += 1

if tail_A > 0 and head_B > 0:
    count = count + B_A + 1
    tail_A -= 1
    head_B -= 1
elif tail_A == 0 and head_B > 0:
    count = count + B_A
    head_B -= 1
elif tail_A > 0 and head_B == 0:
    count = count + B_A
    tail_A -= 1

count += min(tail_A, head_B)
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
 
ans = int(N-K+1)

print(ans)

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
  s = input().split(" ")
  R = int(s[0])
  G = int(s[1])
  B = int(s[2])
  N = int(s[3])
  
  count = 0
  for i in range(N/R+1):
    sumR = R * i
    if sumR == N:
      count += 1
      break
    elif sumR > N:
      break
    else:
      for j in range(N/G+1):
        sumG = G * j
        if sumR + sumG == N:
          count += 1
          break
        elif sumR + sumG > N:
          break
        else:
          for k in range(N/B+1):
            sumB = B * k
            if sumR + sumG + sumB == N:
              count += 1
              break
            elif sumR + sumG + sumB > N:
              break
  print(count)

Submission status: Runtime Error

Solution code:
def count(list):
    a,b,z=0,0,0
    for i in range(len(list)):
        if list[i][0]=='B':
            b+=1
        if list[i][-1]=='A':
            a+=1
        
    if a==b==len(list):
        return a-1
    else:
        
        return min(a,b)
def check(string):
    c=0
    for i in range(len(string)-1):
        if string[i]=='A' and string[i+1]=='B':
            c+=1
    return c
n=int(input())
m,l=0,[]
for i in range(n):
    s=input()
    m+=check(s)
    
    l.append(s)
m+=count(l)
 
print(m)

Submission status: Runtime Error

Solution code:
x=input()
b=int(x[0])
c=int(x[2])
a=b-c+1
print(a)

Submission status: Runtime Error

Solution code:
return 1

Submission status: Runtime Error

Solution code:
import math
r,g,b,n  = (int(i) for i in input().split())
z =  math.factorial(r) * math.factorial(b) * math.factorial(g)
a =  math.factorial(n) // z
print( a)

Submission status: Runtime Error

Solution code:
import numpy as np
import sys
input = sys.stdin.readline
res = 0
p = 0
R, G, B, N = map(int, input().split())
for i in range (N // R + 1):
    for j in range(N // G + 1):
        P =N - i*R - j*G
        if P < 0:
            break
        else:
            if(P % B == 0):
                res += 1


print(res)

Submission status: Runtime Error

Solution code:
N = input()
K = input()

out = (N - K) + 1

print(out)

Submission status: Runtime Error

Solution code:
n = int(input())
n_1 = int(n ** (1/2))
s = 0
 
for i in range(1,n_1):
    if n % i == 0:
        if i < n // i -1:
            s += (n // i) - 1

print(s)

Submission status: Runtime Error

Solution code:
R, G, B, N = map(int, input().split())

def f(a, b):
    sho, amari = int(a/b), a%b
    return sho, amari


def ans(l, m, s):
    cnt = 0

    R_s, R_a = f(N, l)

    for i in range(R_s + 1):
        x = R_a + i * l # R を i 個使う
        G_s, G_a = f(x, m)
        for j in range(G_s + 1):
            y = G_a + j * m # G を j 個使う
            if y % s == 0:
                cnt += 1
    return cnt

li = [R, G, B]
li.sort(reverse=True)

cnt = ans(li[0], li[1], li[2])

print(cnt)

Submission status: Runtime Error

Solution code:
r, g, b, n = map(int, input().split())
count = 0

for i in range(n + 1):
    for j in range(n + 1):
        total = n - r * i - g * j
        if total < 0:
            break
        if total % b == 0:
            count += 1

print(count)

Submission status: Runtime Error

Solution code:
import sys


fin = sys.stdin.readline
N = int(fin())
s_list = [fin().rstrip("\n") for _ in range(N)]
num_AB_in_between = 0
s_Bhoge = 0
s_hogeA = 0
s_BA = 0
for s in s_list:
    if s[0] == "B" and s[-1] == "A":
        s_BA += 1
    elif s[0] == "B":
        s_Bhoge += 1
    elif s[-1] == "A":
        s_hogeA += 1

    for i, char in enumerate(s[:-1]):
        next_char = s[i + 1]
        if char == "A" and next_char == "B":
            num_AB_in_between += 1

# print(s_Bhoge, s_hogeA, s_BA)
if s_BA:
    num_AB_bound = 2 * s_BA - 2 + int(s_Bhoge > 0) + int(s_hogeA > 0)
    num_AB_bound += max(0, min(s_Bhoge - 1, s_hogeA - 1))
    # num_AB_bound += min(s_Bhoge - 1, s_hogeA - 1)
else:
    num_AB_bound = min(s_Bhoge, s_hogeA)
print(num_AB_in_between + num_AB_bound)

Submission status: Runtime Error

Solution code:
N = int(input())
eni_B = 0
end_A = 0
both = 0
count = 0

for i in range(N):
    s = list(input())
    if s[0] == 'B':
        eni_B += 1
    if s[-1] == 'A':
        end_A += 1
    if s[0] == 'B' and s[-1] == 'A':
        eni_B -= 1
        end_A -= 1
        both += 1
    for j in range(len(s)-1):
        if s[j] == 'A':
            if s[j+1] == 'B':
                count += 1


if end_A != 0 or eni_B != 0:
    count = count + min(end_A,eni_B) + both
    print(count)
else :
    print(count)

Submission status: Runtime Error

Solution code:
import bisect
import numpy as np
import scipy as sp
from sys import stdin

r, g, b, n = map(int, input().split())
count = 0

for i in range(n + 1):
    for j in range(n + 1):
        total = n - r * i - g * j
        if total < 0:
            break
        if total % b == 0:
            count += 1

print(count)

Submission status: Runtime Error

Solution code:
lst = list(map(int, input().split()))
N = lst.pop(3)
lst.sort(reverse=True)
R,G,B = lst
sum = 0
for i in range(int(N / R) + 1):
  for j in range(int((N - (i * R)) / G) + 1):
    for k in range(int((N - (i * R) - (j * G)) / B) + 1):
      ans = i * R + j * G + k * B
      if (ans == N):
        sum += 1
print(sum)

Submission status: Runtime Error

Solution code:
def count(list):
    a,b=0,0
    for i in range(len(list)):
        if list[i][0]=='B':
            b+=1
        if list[i][-1]=='A':
            a+=1
    if a==b:
        return a-1
    else:
        return min(a,b)
def check(string):
    c=0
    for i in range(len(string)-1):
        if string[i]=='A' and string[i+1]=='B':
            c+=1
    return c
n=int(input())
m,l=0,[]
for i in range(n):
    s=input()
    m+=check(s)
    
    l.append(s)
m+=count(l)

print(m)

Submission status: Runtime Error

Solution code:
a,b,c,d= input().split()
N = int(d)
R= int(a)
G = int(b)
B = int(c)

max_r = N//R
max_g = N//G
max_b = N//B
count = 0
for i in range(max_r+1):
 rest_n_r= N - R*i
 max_g = rest_n_r // G
 for j in range(max_g+1):
  rest_n_r_g = rest_n_r - G*j
  mod = rest_n_r_g % B
  if(mod == 0):
   count += 1

print(count)

Submission status: Runtime Error

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

print(a[0]-a[1]+1)

Submission status: Runtime Error

Solution code:
import bisect
import numpy as np
import scipy as sp
from sys import stdin

r, g, b, n = map(int, input().split())
count = 0

for i in range(n + 1):
    for j in range(n + 1):
        total = n - r * i - g * j
        if total < 0:
        	break
        if total % b == 0:
            count += 1

print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 0
ls = 0
rs = 0
lr = 0
for _ in range(N):
    s = str(input())
    if "AB" in s:
        ans += 1
    if s[-1] == "A" and s[0] == "B":
        lr += 1
    elif s[-1] == "A":
        rs += 1
    elif s[0] == "B":
        ls += 1
if ls == 0 and rs == 0:
    ans += lr - 1 
elif ls == 0 and rs != 0:
    ans += lr
elif ls != 0 and rs == 0:
    ans += lr
else:
    lr += 1
    rs -= 1
    ls -= 1
    ans += lr
    ans += (rs+ls)//2
#ans += lr
print(ans)

Submission status: Runtime Error

Solution code:
def main():
    A = int(input())
    B = int(input())
    print(A - B + 1)
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
i = int(input())

print(n-k+1)

Submission status: Runtime Error

Solution code:
n,k = int(input().split)

print(n-k+1)

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
 
ans = int(N-K+1)
 
print(ans)

Submission status: Runtime Error

Solution code:
import sys
N = int(input())
S = [input() for _ in range(N)]
a = 0
b = 0
ans = 0
aru = False
zenaru = True
for s in S:
    TB = (s[0] == 'B')
    TA = (s[-1] == 'A')
    ans += s.count('AB')
    if TB:
        b += 1
        aru = True
    if TA:
        a += 1
        aru = True
    if TA ^ TB:
        zenaru = False
if a == 0 or b == 0:
    print(ans)
    sys.exit()
print(ans + min(a, b) - zenaru)

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
 
ans = int(N-K+1)
 
print ans

Submission status: Runtime Error

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

for i in range(N):
   S = S+i+1 if N//(i+1)==N%(i+1) else S

print(S)

Submission status: Runtime Error

Solution code:
def count(list):
    a,b=0,0
    for i in range(len(list)):
        if list[i][0]=='B':
            b+=1
        if list[i][-1]=='A':
            a+=1
    return min(a,b)
def check(string):
    c=0
    for i in range(len(string)-1):
        if string[i]=='A' and i+1<len(string) and string[i+1]=='B':
            c+=1
    return c
n=int(input())
m,l=0,[]
for i in range(n):
    s=input()
    m+=check(s)
    
    l.append(s)
m+=count(l)

print(m)

Submission status: Runtime Error

Solution code:
R,G,B,N=map(int, input().split())

x = 0
for i in range(N//R+1):
    k = N - (i*R)
    for j in range(k//G+1):
        l = k - (j*G)
        if l % B == 0:
            x += 1
        else:
            x += 0

print(x)

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
  s = input().split(" ")
  R = int(s[0])
  G = int(s[1])
  B = int(s[2])
  N = int(s[3])
  
  count = 0
  for i in range(R):
    sumR = R * i
      for j in range(G):
        sumG = G * j
        for k in range(B):
          sumB = sumB * k
          if sumR + sumG + sumB == N:
            count += 1
            break
  print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
k = int(input())
ans = n - (k - 1)
print(ans)

Submission status: Runtime Error

Solution code:
import math
r,g,b,n = [int(u) for u in input().split(" ")]
i = 0
for ir in range(math.floor(n/r)+1):
  if ir*r>n:
    break
  for ig in range(math.floor(n/g)+1):
    if ig*g>n:
      break
    y = n- (ir*r+ig*g)
    if y<0:
      break
    if y>=0 and y%b==0:
      #print(ir,ig,y/b)
      i+=1
print(i)

Submission status: Runtime Error

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

print(N-(K-1))

Submission status: Runtime Error

Solution code:
N = int(input())
s=[input() for i in range(N)]
ans=0
for st in s:
    ans+= st.count("AB")

a_cnt=0
b_cnt=0
ab_cnt=0
for i in range(N):
    if s[i][-1]=="A":
        a_cnt+=1
    if s[i][0]=="B":
        b_cnt+=1
    if s[i][-1]=="A" and s[i][0]=="B":
        ab_cnt+=1
ans+=min(a_cnt,b_cnt)
if ab_cnt==b_cnt==a_cnt:
    if ab_cnt!=0:
        ans-=1

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
S = [input() for _ in range(n)]

count = 0
ba = 0
wa = 0
bw = 0
for s in S:
    count += s.count('AB')
    if s[0] == 'B' and s[-1] == 'A':
        ba += 1
    elif s[0] == 'B':
        bw += 1
    elif s[-1] == 'A':
        wa += 1

if ba:
    count += ba - 1
    ba = 1
if ba:
    if wa and bw:
        count += 2
        wa -= 1
        bw -= 1
        ba -= 1
    if ba:
        if wa < bw:
            wa += 1
        else:
            bw += 1
count += min(wa,bw)

print(count)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
n1 = 1
while n > 0:
    n1 *= n
    n -= 1
r = n - k
r1 = 1
while r > 0:
    r1 *= r
    r -= 1
k1 = 1
while k1 > 0:
    k1 *= k
    k -= 1
print(n1/(r1*k1))

Submission status: Runtime Error

Solution code:
def combinations(N, K):
    N = int(N)
    K = int(K)
    elif N == K:
        return 1
    else:
        return N - K + 1
    
N, K = input().split(' ')

print(combinations(N, K))

Submission status: Runtime Error

Solution code:
R, G, B, N = map(int, input().split())
R, G, B = sorted([R, G, B])

i = 0
for r in range(N // R + 1):
    for g in range((N - r) // G + 1):
        bb = (N - r*R - g*G)
        if bb >= 0 and bb % B == 0:
            i += 1

print(i)

Submission status: Runtime Error

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

for i range(1, a+1):
    if i + b < a:
        ans = ans +1

print(ans)

Submission status: Runtime Error

Solution code:
R, G, B, N = map(int,input().split())
cnt = 0
for r in range(N//R + 1):
    for g in range(N//G + 1):
        x = (N - R*r - G*g) / B
        if isinstance(x, int):
            cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
n,k=map(int,input(),split())
print(n-k+1)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define ll long long
#define INF INT_MAX 
#define mod 1000000007
using namespace std;
int main(){
    int N,K;
    cin >> N >> K;
    cout << N-K+1 << endl;
}

Submission status: Runtime Error

Solution code:
r,g,b,n = map(int,input().split())

i,j,k = 0,0,0

ans = 0

while True:
	temp = i * r
	j,k = 0,0
	if(temp > n):
		break
	while True:
		temp = i * r + j * g
		k = 0
		if(temp > n):
			break
		while True:
			temp = i * r + j * g + k * b
			#print(temp)
			if(temp > n): break
			if (temp == n):
				ans += 1
			k += 1
		j+= 1
	i += 1

print(ans)

Submission status: Runtime Error

Solution code:
N = 
K = 
print(N-K+1)

Submission status: Runtime Error

Solution code:
n, k = (int(i) for i in input().split()) 

a = 0
b = 0
for i in range(1, n):
	a = a +i
for i in range(1, (n -k)):
	b = b + i
	
print(a/b)

Submission status: Runtime Error

Solution code:
import sys

args = sys.argv

max_num = args[1]
kernel = args[2]

print(max_num - kernel + 1)

Submission status: Runtime Error

Solution code:
def combinations(N, K):
    N = int(N)
    K = int(K)
    k_ex = K
    n_ex = N
    n_k_ex = N - K
    for i in range(1, K):
        k_ex *= i
    for i in range(1, N):
        n_ex *= i
    for i in range(1, N - K):
        n_k_ex *= i
    return int(n_ex / (k_ex * n_k_ex))
N, K = input().split(' ')

print(combinations(N, K))

Submission status: Runtime Error

Solution code:
n , k = map(int , input(),split())
ans = n - k + 1
print(ans)

Submission status: Runtime Error

Solution code:
R, G, B, N = map(int, input().split())

cnt = 0

for i in range(N//R + 1):
    for j in range(N//G + 1):
        sum = N - i * R - j * G
        if sum >= 0 and sum % B == 0:
            cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
r,g,b,n=map(int,input().split())
ans=0
for i in range(n//r+1):
    for j in range(n//g+1):
        if (n-(r*i+g*j))%b==0:
            if (n-(r*i+g*j))//b>=0:
                ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
N,K = map(int(input(),split()))
out = N - K + 1
print(out)

Submission status: Runtime Error

Solution code:
import os, sys, re, math

n,k = input().split(',')
print(int(n)-int(k)+1)

Submission status: Runtime Error

Solution code:
import math.factorial as mf

def select(N,K):
  a=mf(N)/(mf(K)*mf(N-K))
  return a

Submission status: Runtime Error

Solution code:
n,k = [int() for i in input().split]
print(n-k+1)

Submission status: Runtime Error

Solution code:
def combinations(N, K):
    N = int(N)
    K = int(K)
    k_ex = K
    n_ex = N
    n_k_ex = N - K
    for i in range(1, K + 1):
        k_ex *= i
    for i in range(1, N + 1):
        n_ex *= i
    for i in range(1, N - K + 1):
        n_k_ex *= i
    return int(n_ex / (k_ex * n_k_ex))
N, K = input().split(' ')

print(combinations(N, K))

Submission status: Runtime Error

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

ans=N-K+1;

input(ans)

Submission status: Runtime Error

Solution code:
N,K = int(input())
out = N - K + 1
print(out)

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
const int MAXN = 4e5 + 5, MAXM = 2e5 + 5, BOUND = 1e7, MOD = 1e9 + 7, INF = 0x3f3f3f3f, base = 10000;
const ll INFL = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1.0), eps = 1e-9;
#define mid l + ((r-l)>>1)
#define lson o<<1,l,m
#define rson o<<1|1,m+1,r
#define lc(x) ch[x][0]
#define pii pair<int,int>
#define vi vector<int>
#define RR register int
#define rc(x) ch[x][1]
#define rep(i,a,b) for(RR i=(a);i<=(b);++i)
#define random(a,b) ((a)+rand()%((b)-(a)+1))
int n, m, k;
int main() {
	ios::sync_with_stdio(false); cin.tie(0);
	cin >> n >> k;
	cout << n - k + 1 << '\n';
	return 0;
}

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
print(N-K+1)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().map)
print(A-B+1)

Submission status: Runtime Error

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

ans = int(N-K+1)

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
print(N-K)

Submission status: Runtime Error

Solution code:
a = raw_input().split()
print(a[0]-a[1]+1)

Submission status: Runtime Error

Solution code:
n, k = [int(i) for i in input().split()]
print n - k + 2

Submission status: Runtime Error

Solution code:
N, K = int(input())

print(N-K+1)

Submission status: Runtime Error

Solution code:
N, K = map(int, input())
print(N - (K - 1))

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>

using namespace std;

typedef long long ll;

long long GCD(long long a, long long b){if(b==0)return a;return GCD(b,a%b);}

int main() {
    int N, K; cin >> N >> K;
    cout << (N - K + 1) << endl;
}

Submission status: Runtime Error

Solution code:
import sys

s = input().split(" ")

print(int(s[0]) - (int(s[1]) - 1)

Submission status: Runtime Error

Solution code:
n k = map(int,input().split())
print(n-k+1)

Submission status: Runtime Error

Solution code:
nk = input()

n = nk.split(' ')[0]
k = nk.split(' ')[1]

answer = n - k + 1
print(answer)

Submission status: Runtime Error

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

print(N-k+1);

Submission status: Runtime Error

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

def solve():
    return str(int.__sub__(*map(int, input().split()),)+1)

if __name__ == '__main__':
    print(solve())

Submission status: Runtime Error

Solution code:
N, K = map(input().split())
print(N-K+1)

Submission status: Runtime Error

Solution code:
n, k = [int(i) for i in input().split()]
return n - k + 1

Submission status: Runtime Error

Solution code:
N, K = map(int, input())

print(N-(K-1))

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define REPR(i, n) for (ll i = (n); i >= 0; i--)
#define FOR(i, m, n) for (ll i = (m); i < (n); i++)
#define FORR(i, m, n) for (ll i = (m); i >= (n); i--)
#define INF 1e9
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((ll)(x).size())
#define SORT(x) sort((x).begin(), (x).end())
#define dump(x) cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl

int main(int argc, char const *argv[])
{
    ll n, k;
    cin >> n >> k;
    cout << n - k + 1 << endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
n, k = map(int, input(9.split()))

print(n-k+1)

Submission status: Runtime Error

Solution code:
n,k = int(input().split())
print(n-k+1)

Submission status: Runtime Error

Solution code:
n,k==map(int,input().split())
print(n-k+1)

Submission status: Runtime Error

Solution code:
N, K = mapt(int, input().split())

print(N-K+1)

Submission status: Runtime Error

Solution code:
N, K = [int(x) for x input().split()]

print(N - K + 1)

Submission status: Runtime Error

Solution code:
N, K = map(int, input())

print(N - K + 1)

Submission status: Runtime Error

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

int main(void){
    int n, k;
    cin >> n >> k;
    cout << n-(k-1) << endl;
}

Submission status: Runtime Error

Solution code:
n , k = imap ( int , input ().split())
ans = n - k + 1
print ( ans)

Submission status: Runtime Error

Solution code:
print(int(input())-int(input())+1)

Submission status: Runtime Error

Solution code:
N,K = map(int,input())
print(N-K+1)

Submission status: Runtime Error

Solution code:
# A
N = int(input())
K = int(input())

print(N-K+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, K = map(int, input())

print(N-K+1)

Submission status: Runtime Error

Solution code:
n, k = list(map(int, input()))

print(n - k + 1)