Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
for i in range(N):
    for j in range(N-i):
        if 10000*i + 5000*j + 1000*(N-i-j) == Y:
            print('{} {} {}'.format(i,j,N-i-j))
            exit()
print("-1 -1 -1")

Fixed submission:
N = int(input())
D = [int(input()) for _ in range(N)]
print(len(set(D)))
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
e,f = a*b,c*d
if e<f: print(f)
  else: print(e)

Fixed submission:
a,b,c,d = map(int,input().split())
e,f = a*b,c*d
if e<f: print(f)
else: print(e)
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int f(vector<int> v, int i, int a) {
    vector<int>::iterator maxIt = max_element(v.begin(), v.end());
    vector<int>::iterator minIt = min_element(v.begin(), v.end());
    if (v.size() == 0){
        return a;
    }
    if(*maxIt == *minIt) {
        return a + (*minIt) - i;
    }
    a+=*minIt-i;
    i = *minIt;
    size_t minIndex = distance(v.begin(), minIt);
    if (minIndex == 0) {
        vector<int> vec;
        copy(next(v.begin()), v.end(), back_inserter(vec));
        a = f(vec, i, a);
    } else if (minIndex == v.size()) {
        vector<int> vec;
        copy(v.begin(), prev(v.end()), back_inserter(vec));
        a = f(vec, i, a);
    } else {
        vector<int> vec1;
        copy(v.begin(), minIt, back_inserter(vec1));
        a = f(vec1, i, a);
        vector<int> vec2;
        copy(next(minIt), v.end(), back_inserter(vec2));
        a = f(vec2, i, a);
    }
    return a;
}


int main() {
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i=0; i<n; i++) {
        cin >> v[i];
    }
    int a = f(v, 0, 0);

    return 0;
}

Fixed submission:
n = int(input())
h = list(map(int, input().split()))

maxNum = max(h)
countNumber = 0
countWatering = 0
isfinished = False
for c in range(1, maxNum+1):
    array = []
    for index, num in enumerate(h):
        if (num >= c):
            array.append(index)
    if (len(array) == 0 or c > maxNum):
        break
    startIndex = 0
    beforeVlaue  = array[0]-1
    for a in array:
        if (a-1 != beforeVlaue):
            countWatering+=1
        if (a == array[-1]):
            countWatering+=1
        beforeVlaue = a
    
print(countWatering)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = list(range(1, N+1))

for i in range(0, N):
    for j in range(N-1, i, -1):
        if A[j] < A[j-1]:
            A[j], A[j-1] = A[j-1], A[j]
            ans[j], ans[j-1] = ans[j-1], ans[j]

print(*ans, sep=" ")

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = list(range( N))

for i in range(N):
    ans[A[i]-1] = i+1

print(*ans, sep=" ")
Buggy python submission (verdict: Runtime Error):
S = str(inpit())

if S == 'Sunny':
    print('Cloudy')
elif S == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')

Fixed submission:
S = str(input())

if S == 'Sunny':
    print('Cloudy')
elif S == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())

# N人の持ち点arrayの初期値を作成する
points = [K]*N

for i in range(Q):
    win = int(input())
    points  = list(map(lambda x: x-1, points))
    points[win-1] += 1

for p in points:
    if p > 0:
        print('Yes')
    else:
        print('No')

Fixed submission:
N, K, Q = map(int, input().split())

# N人の持ち点arrayの初期値を作成する
points = [K-Q]*N

for i in range(Q):
    win = int(input()) -1
    points[win] += 1

for p in points:
    if p > 0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())

# N人の持ち点arrayの初期値を作成する
points = [K]*N

for i in range(Q):
    win = int(input()) -1
    points  = list(map(lambda x: x-1, points))
    points[win] += 1

for p in points:
    if p > 0:
        print('Yes')
    else:
        print('No')

Fixed submission:
N, K, Q = map(int, input().split())

# N人の持ち点arrayの初期値を作成する
points = [K-Q]*N

for i in range(Q):
    win = int(input()) -1
    points[win] += 1

for p in points:
    if p > 0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
a = int(input())
l = len(str(a))

ans = 0
if l % 2 == 0:
    while l >= 1:
        ans += 10 ** (l - 1) - 1
        l -= 2
else:
    ans += a - (10 ** (l - 1) - 1)
    l -= 1
    while l >= 1:
        ans += 10 ** (l - 1) - 1
        l -= 2

print(ans)

Fixed submission:
A, B, C = map(int, input().split())
if C-A+B >= 0:
    print(C-A+B)
else:
    print(int(0))

Buggy python submission (verdict: Runtime Error):
a = int(input())
l = len(str(a))

ans = 0
if l % 2 == 0:
    while l >= 1:
        ans += 10 ** (l - 1) - 1
        l -= 2
else:
    ans += a - (10 ** (l - 1) - 1)
    l -= 1
    while l >= 1:
        ans += 10 ** (l - 1) - 1
        l -= 2

print(ans)

Fixed submission:
A, B, C = map(int, input().split())
if C-A+B >= 0:
    print(C-A+B)
else:
    print(int(0))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = list(map(int, input().split()))

if len(h) == 1:
    print('Yes')
else:
    count = 0
    for i in range(1, len(h)-1):
        if max(h[0:i]) <= h[i+1]+1:
            count += 0
        else:
            count += 1
    
    if count == 0:
        print('Yes')
    else:
        print('No')

Fixed submission:
# 減らせるときは減らす
N = int(input())
h = list(map(int, input().split()))

stop_flg = 0
h[0] = h[0]-1
for i in range(N-1):
    if stop_flg == 0:
        if h[i] <= h[i+1]-1:
            h[i+1] = h[i+1]-1
        elif h[i] == h[i+1]:
            continue
        else:
            stop_flg = 1

if stop_flg == 1:
    print('No')
else:
    print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = list(map(int, input().split()))

if len(h) == 1:
    print('Yes')
else:
    count = 0
    for i in range(len(h)-1):
        if i == 0:
                if h[i] <= h[i+1]+1:
                    count += 0
                else:
                    count += 1
        else:
            if max(h[0:i]) <= h[i+1]+1:
                count += 0
            else:
                count += 1
    
    if count == 0:
        print('Yes')
    else:
        print('No')

Fixed submission:
# 減らせるときは減らす
N = int(input())
h = list(map(int, input().split()))

stop_flg = 0
h[0] = h[0]-1
for i in range(N-1):
    if stop_flg == 0:
        if h[i] <= h[i+1]-1:
            h[i+1] = h[i+1]-1
        elif h[i] == h[i+1]:
            continue
        else:
            stop_flg = 1

if stop_flg == 1:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))

k = 0
counter = 1
for e in p:
    if e == counter:
        counter += 1
    else:
        k += 1
        counter += 1

if k <= 2:
    print('YES')
else:
    print('NO')

Fixed submission:
A, B = map(int, input().split())

if (A+B) % 2 == 1:
    print('IMPOSSIBLE')
else:
    print(int((A+B)/2))
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))

k = 0
counter = 1
for e in p:
    if e == counter:
        counter += 1
    else:
        k += 1
        counter += 1

if k <= 2:
    print('YES')
else:
    orint('NO')

Fixed submission:
N = int(input())
p = list(map(int, input().split()))

k = 0
counter = 1
for e in p:
    if e == counter:
        counter += 1
    else:
        k += 1
        counter += 1

if k <= 2:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))

k = 0
counter = 1
for e in p:
    if e == counter:
        counter += 1
    else:
        k += 1
        counter += 1

if k <= 2:
    print('YES')
else:
    orint('NO')

Fixed submission:
N = int(input())
p = list(map(int, input().split()))

k = 0
counter = 1
for e in p:
    if e == counter:
        counter += 1
    else:
        k += 1
        counter += 1

if k <= 2:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
N = int(input())
p = map(int, input().split())

# 昇順のリスト
asc_l = list(range(1, N))

diff_l = p - asc_l
diff_l.count(0) >= N - 2

Fixed submission:
N = int(input())
p = list(map(int, input().split()))

k = 0
counter = 1
for e in p:
    if e == counter:
        counter += 1
    else:
        k += 1
        counter += 1

if k <= 2:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
N, K, Q = map(int, input().split())
score = np.array([K]*N)


for i in range(Q):
    answer = int(input())
    score[answer - 1] += 1
    score = score - 1


for i in range(N):
    if score[i] <= 0:
        print("No")
    else:
        print("Yes")

Fixed submission:
# -*- coding: utf-8 -*-
S = input()
if S == "Sunny":
    print('Cloudy')
elif S == "Cloudy":
    print('Rainy')
else:
    print('Sunny')
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    h = list(map(int, input().split()))
    ans = 0
    for i in range(n - 1):
        j = i
        count = 0
        while j < n-1:
            # print(h[j])
            # print(h[j + 1])
            # print("=====")
            if h[j] >= h[j + 1]:
                count += 1
                j += 1
                ans = max(ans, count)
            else:
                # ans = max(ans, count)
                break
    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    n = int(input())
    h = list(map(int, input().split()))
    ans = 0
    max_list = [0]
    for i in range(n - 1):
        if h[i] >= h[i + 1]:
            ans += 1
            max_list.append(ans)
        else:
            ans = 0
    print(max(max_list))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import accumulate


def main():
    n = int(input())
    ans = 0
    for i in range(1, n):
        ans += i
    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
from itertools import accumulate


def main():
    n = int(input())
    print(n*(n-1)//2)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
if (a*b)%2 == 0:
  print("Odd")
 else:
  print("Even")

Fixed submission:
a, b = map(int,input().split())
if (a*b)%2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
points=[k]*(n+1)
win=[]
for i in range(q):
  win.append(int(input()))
for j in range(1,n+1):
  if points[j]-(q-win.count(j))>0:
    print('Yes')
  else:
    print('No')

Fixed submission:
n, k, q = map(int, input().split())
points=[k]*(n+1)
cnt=[0]*(n+1)
for i in range(q):
  cnt[int(input())]+=1
for j in range(1,n+1):
  if k-(q-cnt[j])>0:
    print('Yes')
  else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n, m=map(int, input().split())
prices=list(map(int, input().split()))
for i in range(m):
  prices[prices.index(max(prices))]//=2
print(sum(prices))

Fixed submission:
import heapq

n, m=map(int, input().split())
A=list(map(lambda x:int(x)*(-1), input().split()))
heapq.heapify(A)

for _ in range(m):
  temp=(-1)*heapq.heappop(A)>>1
  heapq.heappush(A, temp*(-1))
print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
n, m=map(int, input().split())
prices=list(map(int, input().split()))
for i in range(m):
  prices=sorted(prices,reverse=True)
  prices[0]=prices[0]>>1
print(sum(prices))

Fixed submission:
import heapq

n, m=map(int, input().split())
A=list(map(lambda x:int(x)*(-1), input().split()))
heapq.heapify(A)

for _ in range(m):
  temp=(-1)*heapq.heappop(A)>>1
  heapq.heappush(A, temp*(-1))
print(-sum(A))
Buggy python submission (verdict: Runtime Error):
n=int(input())
List=list(map(int, input().split()))
cnt=[0]*(n-1)
for i in range(n-1):
  if List[i]>=List[i+1]:
    if i==0:
      cnt[i]=1
    else:
      cnt[i]=cnt[i-1]+1
print(max(cnt))

Fixed submission:
n=int(input())
List=list(map(int, input().split()))
ans = 0
cnt = 0
for i in range(n-1):
  if List[i]>=List[i+1]:
    if i==0:
      cnt=1
    else:
      cnt+=1
      ans = max(ans, cnt)
  else:
    cnt=0
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
List=list(map(int, input().split()))
cnt=[0]*(n-1)
ans=0
for i in range(n-1):
  if List[i]>=List[i+1]:
    if i==0:
      cnt[i]=1
    else:
      cnt[i]=cnt[i-1]+1
print(max(cnt))

Fixed submission:
n=int(input())
List=list(map(int, input().split()))
ans = 0
cnt = 0
for i in range(n-1):
  if List[i]>=List[i+1]:
    if i==0:
      cnt=1
    else:
      cnt+=1
      ans = max(ans, cnt)
  else:
    cnt=0
print(ans)

Buggy python submission (verdict: Runtime Error):
=int(input())
List=list(map(int, input().split()))
cnt=[0]*(n-1)
ans=0
for i in range(n-1):
  if List[i]>=List[i+1]:
    if i==0:
      cnt[i]=1
    else:
      cnt[i]=cnt[i-1]+1
print(max(cnt))

Fixed submission:
n=int(input())
List=list(map(int, input().split()))
ans = 0
cnt = 0
for i in range(n-1):
  if List[i]>=List[i+1]:
    if i==0:
      cnt=1
    else:
      cnt+=1
      ans = max(ans, cnt)
  else:
    cnt=0
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n==1:
  print(0)
if n==2:
  print(1)
else:
  ans=1
  for i in range(3,n+1):
    ans+=(i-1)
print(ans)

Fixed submission:
n=int(input())
if n==1:
  print(0)
else:
  print(n*(n-1)//2)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
cnt=0
if n==1:
  print(0)
else:
  for i in range(1,n):
    cnt+=i%(i+1)
  print(cnt)

Fixed submission:
n=int(input())
if n==1:
  print(0)
else:
  print(n*(n-1)//2)
Buggy python submission (verdict: Runtime Error):
from collections import deque

n, q = map(int, input().split())
G = [[] for yy in range(n)]
count = [0]*n
flag=[False]*n
stack = deque([0])

for _ in range(n-1):
  a, b = map(int, input().split())
  G[a-1].append(b-1)
  G[b-1].append(a-1)
  
for _ in range(q):
  p, x = map(int, input().split())
  count[p-1] += x

stack.append(0)
while stack:
  v = stack.pop()
  flag[v] = True
  for e in G[v]:
    if flag[e]:
      continue
    count[e] += count[v]
    stack.append(e)

print(*count)

Fixed submission:
a=int(input())
s=input()
if a>=3200:
  print(s)
else:
  print('red')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(sys.stdin.readline().strip())
list = []
ans = 0
for x in range(n):
  list.append(sorted(''.join(sys.stdin.readline().strip())))
for i in range(len(list)-1):
  for j in range(i+1, n):
    if list[i] == list[j]:
      ans +=1
print(ans)

Fixed submission:
import sys
n = int(sys.stdin.readline().strip())
list = [''.join(sorted(sys.stdin.readline().strip())) for i in range(n)]
d = {}
ans = 0
for x in list:
  if x in d:
    ans += d[x]
    d[x] += 1
  else:
    d[x] = 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(sys.stdin.readline().strip())
list = []
ans = 0
for x in range(n):
  list.append(sorted(sys.stdin.readline().strip()))
for i in range(len(list)-1):
  for j in range(i+1, n):
    if list[i] == list[j]:
      ans +=1
print(ans)

Fixed submission:
import sys
n = int(sys.stdin.readline().strip())
list = [''.join(sorted(sys.stdin.readline().strip())) for i in range(n)]
d = {}
ans = 0
for x in list:
  if x in d:
    ans += d[x]
    d[x] += 1
  else:
    d[x] = 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
list = []
ans = 0
for x in range(n):
  list.append(sorted(input()))
for i in range(len(list)-1):
  for j in range(i+1, n):
    if list[i] == list[j]:
      ans +=1
print(ans)

Fixed submission:
import sys
n = int(sys.stdin.readline().strip())
list = [''.join(sorted(sys.stdin.readline().strip())) for i in range(n)]
d = {}
ans = 0
for x in list:
  if x in d:
    ans += d[x]
    d[x] += 1
  else:
    d[x] = 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print('Yes' if a+b>=c, else 'No')

Fixed submission:
a, b, c = map(int, input().split())
print('Yes' if a+b>=c else 'No')
Buggy python submission (verdict: Runtime Error):
S=input()
print(S[0]+int(len(S)-2)+S[-1])

Fixed submission:
s=input()
print(s[0]+str(len(s)-2)+s[-1])
Buggy python submission (verdict: Runtime Error):
import itertools
import math

n,d = map(int,input().split())
x = [[int(i) for i in input().split()] for i in range(n)] 
seq = list(itertools.combinations(range(n),d))
tmp = 0.0
cnt = 0

for i,j in seq:
    for k in range(d):
        tmp += (x[i][k] - x[j][k])**2
    tmp = math.sqrt(tmp)
    if tmp.is_integer():
        cnt += 1
print(cnt)

Fixed submission:
import itertools
import math

n,d = map(int,input().split())
x = [[int(i) for i in input().split()] for i in range(n)] 
seq = list(itertools.combinations(range(n),2))
tmp = 0.0
cnt = 0
for i,j in seq:
    for k in range(d):
        tmp += (x[i][k] - x[j][k])**2
    tmp = math.sqrt(tmp)
    if tmp.is_integer():
        cnt += 1
    tmp = 0.0
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
l,r = map(int,input().split())
r = min(r,l+4038)
ans = 2018

for i in range(l,r+1):
    for j in range(i+1,r+1):
        ans = min(i*j%2019,ans)
print(ans)

Fixed submission:
l,r = map(int,input().split())
r = min(r,l+678)
ans = 2018

for i in range(l,r+1):
    for j in range(i+1,r+1):
        ans = min(i*j%2019,ans)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
l,r = map(int,input().split())
r = min(r,l+4038)
mod = 0
ans = 2018

for i in range(l,r+1):
    for j in range(i+1,r+1):
        mod = i*j%2019
        ans = min(mod,ans)
        
print(ans)

Fixed submission:
l,r = map(int,input().split())
r = min(r,l+678)
ans = 2018

for i in range(l,r+1):
    for j in range(i+1,r+1):
        ans = min(i*j%2019,ans)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
l,r = map(int,input().split())
mods = l*r
for i in range(l,r+1):
    for j in range(l,i+1):
        if i == j:
            continue
        else:
            q, mod = divmod(i*j, 2019)
            mods = min(mod,mods)
print(mods)

Fixed submission:
l,r = map(int,input().split())
r = min(r,l+678)
ans = 2018

for i in range(l,r+1):
    for j in range(i+1,r+1):
        ans = min(i*j%2019,ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
#B
count = 0
n,m,c = map(int, input().split())
b = list(map(int, input().split()))
for i in range(n):
    a = list(map(int, input().split()))
    ab=0
    for j in range(n):
        ab = a[j] * b[j]
    if -c<ab:
        count += 1
print(count)

Fixed submission:
#A
H,W = map(int, input().split())
h,w = map(int, input().split())

print((H-h)*(W-w))
Buggy python submission (verdict: Runtime Error):
#B
count = 0
n,m,c = map(int, input().split())
b = list(map(int, input().split()))
for i in range(n):
    a = list(map(int, input().split()))
    ab=0
    for j in range(n):
        ab = a[j] * b[j]
    if -c<ab:
        count += 1
print(count)

Fixed submission:
#B
count = 0
n,m,c = map(int, input().split())
b = list(map(int, input().split()))
for i in range(n):
    a = list(map(int, input().split()))
    ab=0
    for j in range(m):
        ab += a[j] * b[j]
    if -c<ab:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
#C
n,m = map(int, input().split())
ab = [[int(i) for i in input().split()] for i in range(n)]

ab.sort(key=lambda x:x[0])
cost = 0
for i in range(m):
    value = ab[i][0]
    num = ab[i][1]
    if num> m:
        cost += value*m
        break
    else:
        cost += value*num
        m -= num
print(cost)

Fixed submission:
#C
n,m = map(int, input().split())
ab = [[int(i) for i in input().split()] for i in range(n)]

ab.sort(key=lambda x:x[0])
cost = 0
for i in range(n):
    value = ab[i][0]
    num = ab[i][1]
    if num> m:
        cost += value*m
        break
    else:
        cost += value*num
        m -= num
print(cost)
Buggy python submission (verdict: Runtime Error):
a=int(input())
s=input()
if a>=3200:a
    print("s")
else:
    print("red")

Fixed submission:
a=int(input())
s=input()
if a>=3200:
    print(s)
else:
    print("red")
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
if k=1:
 print("0")
else:
	print(n-k) 

Fixed submission:
n,k=map(int,input().split())
if k==1:
	print("0")
else:
	print(n-k)

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
if k=1:
 print("0")
else:
print(n-k) 

Fixed submission:
n,k=map(int,input().split())
if k==1:
	print("0")
else:
	print(n-k)
Buggy python submission (verdict: Runtime Error):
s=input()
first=int(s[0]+s[1])
second=int(s[2]+s[3])
if 1<=first<=12 and 1<=second<=12:
	print("AMBIGUOUS")
elif 1<=first<=12 and (second==0 or second>=13):
		print("MMYY")
elif (first==0 or first>=13) or 1<=second<=12:
		print("YYMM")
else:
		print("NA")

Fixed submission:
n,k=map(int,input().split())
s=input()
if s[k-1]=="A":
	print(s[0:k-1]+"a"+s[k:n])
elif s[k-1]=="B":
	print(s[0:k-1]+"b"+s[k:n])
else:
	print(s[0:k-1]+"c"+s[k:n])
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N=map(int,input().split())
ans=0
for i in range(N+1):
	for j in range (N+1):
		z=N-(R*i+G*j)
		if z>=0 and z%B==0:
			ans+=1
print(ans)			



Fixed submission:
R,G,B,N=map(int,input().split())
ans=0
for i in range(N+1):
	for j in range (N+1):
		z=N-(R*i+G*j)
		if z>=0 and z%B==0:
			ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N=map(int,input().split())
ans=0
for i in range(N+1):
	for j in range (N+1):
		z=N-(R*i+G*j)
		if z>=0 and z%B==0:
			ans+=1
print(ans)			



Fixed submission:
R,G,B,N=map(int,input().split())
ans=0
for i in range(N+1):
	for j in range (N+1):
		z=N-(R*i+G*j)
		if z>=0 and z%B==0:
			ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(in,input().split())
if a>b:
	print(a*2-1)
elif a<b:
	print(b*2-1)
else:
	print(a+b)

Fixed submission:
a,b=map(int,input().split())
if a>b:
	print(a*2-1)
elif a<b:
	print(b*2-1)
else:
		print(a+b)

Buggy python submission (verdict: Runtime Error):
a,b=map(in,input().split())
if a>b:
	print(a*2-1)
elif a<b:
	print(b*2-1)
else:
		print(a+b)

Fixed submission:
a,b=map(int,input().split())
if a>b:
	print(a*2-1)
elif a<b:
	print(b*2-1)
else:
		print(a+b)