Problem:


Score : 100 points

Problem Statement

On some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in yyyy/mm/dd format. For example, January 23, 2018 should be written as 2018/01/23.

After finishing the document, she noticed that she had mistakenly wrote 2017 at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to 2018 and prints it.

Constraints

S is a string of length 10.

The first eight characters in S are 2017/01/.

The last two characters in S are digits and represent an integer between 1 and 31 (inclusive).

Input

Input is given from Standard Input in the following format:

S

Output

Replace the first four characters in S with 2018 and print it.

Sample Input 1

2017/01/07

Sample Output 1

2018/01/07

Sample Input 2

2017/01/31

Sample Output 2

2018/01/31



Sample input:
2017/01/07


Sample output:
2018/01/07

Submission status: Runtime Error

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

N = all[0]
Y = all[1]
yukichi = 0
higuchi = 0
noguchi = 0
handler = True
for i in range(1, N+1):
    Y -= 10000
    if Y==0:
        handler = False
        yukichi += 1
        break
    elif Y<0:
        Y += 10000
        break
    yukichi += 1

if handler:
    for i in range(1, N+1):
        Y -= 5000
        if Y==0:
            handler = False
            higuchi += 1
            break
        elif Y<0:
            Y += 5000
            break
        higuchi += 1

if handler:
    for i in range(1, N+1):
        Y -= 1000
        if Y==0:
            noguchi += 1
            break
        elif Y<0:
            yukichi = -1
            higuchi = -1
            noguchi = -1
            break
        noguchi += 1

print(str(yukichi) + " " + str(higuchi) + " " + str(noguchi))

Submission status: Runtime Error

Solution code:
N = int(input())
d = []
for i in range(N):
    d.append(int(input()))
s = list(set(d))
print(len(s))

Submission status: Runtime Error

Solution code:
n, h = map(int, input().split())
a = [0]*n
b = [0]*n
maxa = 0
for i in range(n):
    a[i], b[i] = map(int, input().split())
    maxa = max(maxa, a[i])

c = []
for i in range(n):
    if b[i] >= maxa:
        c.append(b[i])
        
c.sort()
csum = sum(c)
count = len(c)

if csum >= h:
    i = 0
    while csum - c[i] >= h:
        if i == len(c):
            break
        else:
            csum -= c[i]
            i += 1
            count -= 1
else:
    if (h - csum) % maxa == 0:
        count += (h - csum) // maxa
    else:
        count += (h - csum) // maxa
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
N,Y=map(int,input().split())
for x in range(N+1):
  for y in range(N-x+1):
    z=N-x-y
    if 10000*x+5000*y+1000*z==Y:
      print(x,y,z)
      
    else:
        continue
        break
print(-1,-1,-1)

Submission status: Runtime Error

Solution code:
n,y = map(int,input().split())
d = 0

for a in range(n+1):#10000
    for b in range(n+1):#5000
        c = n - a - b
        x = 10000*a + 5000*b + 1000*c
        if x == y and c >=0:
            print("{} {} {}".format(a,b,c))
            d =1
            break
    else:
        continue
    break



if d == 0:
    print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
n,y = map(int,input().split())
d = 0

for a in range(n):#10000
    for b in range(n):#5000
        c = n - a - b
        x = 10000*a + 5000*b + 1000*c
        if x == y and c >=0:
            print("{} {} {}".format(a,b,c))
            d =1
            break
    else:
        continue
    break



if d == 0:
    print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
a,b,c=map(int,inpput().split('/'))
a=2018
print(a,'/',b,'/',c)

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())
A = [-1, -1, -1]
for i in range(n + 1):
    for j in range(n - i + 1):
        if y == 10000 * i + 5000 * j + 1000 * (n - i - j):
            A = [i, j, n - i - j]
            break
    else:
        continue
    break

print('{} {} {}'.format(A[0], A[1], A[2]))

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())
x = 0
for i in range(n + 1):
    # if 10000*i > y:break
    for j in range(n - i + 1):
        # if 10000 * i + 5000 * j > y:
        #     break
        if 10000 * i + 5000 * j + 1000 * (n - i - j) == y:
            print(i, j, n - i - j)
            x = 1
            break

    if x == 1:
        break

if x == 0:
    print(-1,-1,-1)

Submission status: Runtime Error

Solution code:
N = int(input())
d = [map(int,input()) for i in range(N)]
print(len((set(d)))

Submission status: Runtime Error

Solution code:
N, Y = list(map(int, input().split()))
results = [-1, -1, -1]
for x in range(N + 1):
    for y in range(N - x + 1):
        z = (N - x - y)
        if 0 <= z <= 2000 and Y == 10000 * x + 5000 * y + 1000 * z:
            results = [x, y, z]
            print(results)
            exit()
print(results)

Submission status: Runtime Error

Solution code:
n, yen = map(int, input().split())
yen //= 1000

for noguchi in range(n + 1):
    for higuchi in range(n + 1 - noguchi):
        yukichi = n - noguchi - higuchi
        if noguchi + higuchi * 5 + yukichi * 10 == yen:
            print(yukichi, higuchi, noguchi)
            exit(0)
print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
def main():
    num, yen_sum = map(int, input().split())
    yen_sum /=1000
    res = [-1, -1, -1]
    for bill_10000 in range(num+1):
        if bill_10000*10 + (num-bill_10000+1)*5 <= yen_sum:
            continue
        for bill_5000 in range(num-bill_10000+1):
            bill_1000 = num - bill_10000 - bill_5000
            if bill_10000*10 + bill_5000*5 + bill_1000*1 == yen_sum:
                res = [bill_10000, bill_5000, bill_1000]
                break
    print(*res)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N=int(input())
d=[0 for i in range(N)]
for i in range(N):
	d[i]=int(input())
for i in range(N):
	for j in range(N-1):
		if d[j]<=d[j+1]:
			temp=d[j]
			d[j]=d[j+1]
			d[j+1]=temp
i=0
while(i<len(d)-1):
	if d[i]==d[i+1]:
		del(d[i+1])
	i=i+1
print(len(d))

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())
j=True
if y % 1000 != 0 or y // 10000 > n:
    print(-1, -1, -1)

for th in range(0, n+1) :
    for fh in range(0, n-th+1) :
        if th * 10000 + fh * 5000 + (n-fh-th) * 1000 == y :
            print (th, fh, n-fh-th)
            j = False
            break
    else :
        continue
    break
if j == True:
    print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
n,Y = map(int,input().split())
Y = int(Y / 1000)
ans = [-1,-1,-1]
for x in range(n):
    for y in range(n):
        if 10*x + 5*y + (n-x-y) == Y and n-x-y >= 0:
            ans = [x,y,n-x-y]
print(*ans)

Submission status: Runtime Error

Solution code:
n,Y = map(int,input().split())
Y = int(Y / 1000)
ans = [-1,-1,-1]
for x in range(n):
    for y in range(n):
        if 10*x + 5*y + (n-x-y) == Y and n-x-y => 0:
            ans = [x,y,n-x-y]
print(*ans)

Submission status: Runtime Error

Solution code:
import math


def find_argmax(num_list):
    argmax = sorted(enumerate(num_list), key=lambda x:x[1])[-1][0]
    return argmax


def find_all_more_than(threshold, num_list):
    indices = [
        idx
        for idx, num in enumerate(num_list) 
        if num > threshold
    ]
    return indices


def read_input():
    initial_inputs = input().split(" ")
    N = int(initial_inputs[0])
    H = int(initial_inputs[1])
    a_list = []
    b_list = []
    for _ in range(N):
        inputs = input().split(" ")
        a = int(inputs[0])
        b = int(inputs[1])
        a_list.append(a)
        b_list.append(b)
    return N, H, a_list, b_list


# TLE
def searchA(N, H, a_list, b_list):
    # initialize used_indices
    used_indices = [ False for b in b_list]

    # initialize search_area
    search_area = [ b for b in b_list ]

    # count how many times
    times_count = 0
    
    while H > 0:
        # search
        idx = find_argmax(search_area)

        # check
        if used_indices[idx]:
            # calculate rest and finish
            rest_count = math.ceil(H / search_area[idx])
            return times_count + rest_count

        # attack
        H -= search_area[idx]

        # change
        search_area[idx] = a_list[idx]
        used_indices[idx] = True
        
        # count
        times_count += 1

    return times_count


def searchB(N, H, a_list, b_list):
    # initialize used_indices
    used_indices = [ False ] * N

    # initialize search_area
    search_area = [ b for b in b_list ]

    # count how many times
    times_count = 0

    # pick up b indices higher than max(a_list)
    higher_b_indices = find_all_more_than(max(a_list), b_list)
    for idx in higher_b_indices:
        if not H > 0:
            return times_count

        used_indices[idx] = True

        # attack
        H -= search_area[idx]
        times_count += 1

        # change
        search_area[idx] = a_list[idx]
        used_indices[idx] = True

    while H > 0:
        # search
        idx = find_argmax(search_area)

        # check
        if used_indices[idx]:
            # calculate rest and finish
            rest_count = math.ceil(H / search_area[idx])
            return times_count + rest_count

        # attack
        H -= search_area[idx]
        times_count += 1

        # change
        search_area[idx] = a_list[idx]
        used_indices[idx] = True
        
    return times_count


def main():
    # read input
    N, H, a_list, b_list = read_input()

    # search
    times_count = searchB(N, H, a_list, b_list)

    # output
    print(times_count)
    

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
S = input()

print( 2018 + S[:4])

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

n,h=MI()
A=[]
B=[]
for i in range(n):
    a,b=MI()
    A.append(a)
    B.append(b)
#print(B)
A.sort(reverse=True)
B.sort(reverse=True)
ace=A[0]
throw=[]
for b in B:
    if b>ace:
        throw.append(b)
if h>sum(throw):
    slash1=ceil((h-sum(throw))/ace)
    h-=ace*slash1
    ans=slash1+len(throw)
else:
    for i in range(len(throw)):
        h-=throw[i]
        if h<=0:
            ans=i+1
            break
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
print(s.replace(a[0:4], '2018'))

Submission status: Runtime Error

Solution code:
N, Y  = map(int, input().split())
flag = False
for i in range(1,N): # 1000
    for j in range(1,N): #5000
        k=N-i-j
        total = i*1000 + j*5000 + k*10000
           
        if(N==i+j+k and total==Y):
            flag = True
            print(str(k)+" " +str(j) +" "+ str(i))
            break

if flag == False:
    print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
s = input()
s[3] = "8"
print(s)

Submission status: Runtime Error

Solution code:
s = input()
s[3] = '8'
print(s)

Submission status: Runtime Error

Solution code:
s = input()
s[3] = 7
s[8], s[9] = int()

Submission status: Runtime Error

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


a = -1
b = -1
c = -1

flag = 0

for i in range(N + 1):
    if flag == 1:
        break
    if  Y - 10000 * i  == 0 & i == N:
        a = i
        b = 0
        c = 0
        flag = 1

    #if Y - 10000 * i - 5000 * (N - i) <= 0:
    for j  in range(N-i,N+1):
        if Y - 10000 * i - 5000 * j  - 1000 * (N - i -j)<= 0:
            for k in range(N-i-j,N + 1):
                if Y - 10000 * i - 5000 * j - 1000 * k == 0:
                    a = i
                    b = j
                    c   = k
                    flag = 1
                    break


print(str(a) +' '+ str(b) +' '+ str(c))

Submission status: Runtime Error

Solution code:
s = input()
print("2017/01/"+s[-2:]

Submission status: Runtime Error

Solution code:
s = input()
new_s = s.replace(s[3],8)
print(new_s)

Submission status: Runtime Error

Solution code:
s = input()
new_s = s.replace(s[3],8)

Submission status: Runtime Error

Solution code:
def resolve():
    # 整数 1 つ
    n = str(input().rstrip())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]
    n[3] = "8"

    print(n)

resolve()

Submission status: Runtime Error

Solution code:
def resolve():
    # 整数 1 つ
    n = str(input().rstrip())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]
    n[3] = "8"

    print(n, end="")


resolve()

Submission status: Runtime Error

Solution code:
def resolve():
    # 整数 1 つ
    n = str(input().rstrip())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]
    n[3] = "8"

    print(n)


resolve()

Submission status: Runtime Error

Solution code:
def resolve():
    # 整数 1 つ
    n = str(input())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]
    n[3] = "8"

    print(n)


resolve()

Submission status: Runtime Error

Solution code:
line = input().split()
sheet = int(line[0])
total =int(line[1])
total_store =total
out = [0,0,0]
sheet_count =0

for i in range(sheet):
  switch_10000 =0
  switch_5000 =0
 
  if int(total /10000 )>0 and sheet_count <sheet:
    total -=10000
    sheet_count +=1
    out[0] +=1
    switch_10000 +=1

  if int(total/5000)>0 and sheet_count <sheet and switch_10000 ==0:
    total -=5000
    sheet_count +=1
    out[1] +=1
    switch_5000 +=1
  if int(total/1000)>0 and sheet_count <sheet and switch_10000 ==0 and switch_5000 ==0:
    total -=1000
    sheet_count +=1
    out[2] +=1

if out[0]*10000+out[1]*5000+out[2]*1000 ==total_store:
  if sum(out)==sheet:
     print(out[0],out[1],out[2])
  else:
    out[0] =0
    out[1] =0
    out[2] =int(total_store/1000)
    cnt =0
    while sum(out) !=sheet_count and out[2]>=0:
      out[2] -=5
      out[1] +=1
      cnt +=1
      
      if sum(out)==sheet and out[2]>=0:
        print(out[0],out[1],out[2])
      if cnt%2==0:
        out[1] -=2
        out[0] +=1
      if sum(out)==sheet and out[2]>=0:
        print(out[0],out[1],out[2])

  
   
else:
  print(-1,-1,-1)

Submission status: Runtime Error

Solution code:
s = input()
s = s.replece(s[3], "8")
print(s)

Submission status: Runtime Error

Solution code:
n = int(input())
print(len(set(map(int,[input() for i in range(n)]))))

Submission status: Runtime Error

Solution code:
S = list(str,input())
S[3] = str(8)
print(S)

Submission status: Runtime Error

Solution code:
S = input()
S[3] = '8'
print(S)

Submission status: Runtime Error

Solution code:
S = list(map(str, input().split()))
S[3] = '8'
print(S)

Submission status: Runtime Error

Solution code:
S = list(map(str, input().split()))
del S[2]
S.insert(2,7)
print(S)

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

read = sys.stdin.read

n = int(input())
d = np.array(read().split(), np.int64)

ans = len(np.unique(d))
print(ans)

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
for x in range(N+1):
    for y in range(N-x+1):
        z = N-x-y
        if 10000*x+5000*y+1000*z == Y:
            print(x, y, z)
            exit()
print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
N,Y = map(int, input().split())
for i in range(N+1):
  for j in range(N+1-i):
    k = N-i-j
      if Y == 10000*i + 5000*j + 1000*k:
        print(i j k)
        sys.exit()
print(-1 -1 -1)

Submission status: Runtime Error

Solution code:
num = int(input())
mochi = [int(input()) for m in range(0, num)]
maisuu = len(set([n for n in mochi]))
print(maisuu)

Submission status: Runtime Error

Solution code:
a=str(input())
a.replace(a[3],"8")
prnit(a)

Submission status: Runtime Error

Solution code:
print("2018"+input()(4:))

Submission status: Runtime Error

Solution code:
s=str(input())
s[3]="8"
print(s)

Submission status: Runtime Error

Solution code:
s=str((input())
s[3]="8"
print(s)

Submission status: Runtime Error

Solution code:
s=str(input())
s[3]='8'
print(s)

Submission status: Runtime Error

Solution code:
s=str(input())
s.replace(s[3],'8')'
print(s)

Submission status: Runtime Error

Solution code:
s=str(input())
a=s.replace(s[3],'8')'
print(a)

Submission status: Runtime Error

Solution code:
s=int(input())
s[3]='8'
print(s)

Submission status: Runtime Error

Solution code:
S=input()
S[3]="8"
print(S)

Submission status: Runtime Error

Solution code:
s = input()
print(s[:3]+8+s[4:])

Submission status: Runtime Error

Solution code:
print(input().replace('2017', '2018')

Submission status: Runtime Error

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

N, Y = map(int, input().split())
result_10000, result_5000, result_1000 = -1, -1, -1
found = False

# 効率を考えて、1万円札 → 5000円札 → 1000円札の順で求める
# 1万円札の数をY//10000から一つずつ減らして調べていく
for num_10000 in reversed(range(0, Y//10000 + 1)):
    y_10000 = Y - 10000 * num_10000
    n_10000 = N - num_10000
    if y_10000 == 0 and n_10000 == 0:
        result_10000, result_5000, result_1000 = num_10000, 0, 0
        found = True
        break
    else:
        for num_5000 in reversed(range(0, y_10000//5000 + 1)):
            y_5000 = y_10000 - 5000 * num_5000
            n_5000 = n_10000 - num_5000
            if y_5000 < 0 or n_5000 < 0:
                break
            if y_5000 == 0 and n_5000 == 0 and num_10000 + num_5000 == N:
                result_10000, result_5000, result_1000 = num_10000, num_5000, 0
                found = True
                break
            else:
                # 10000円札と5000円札の枚数が決まれば必然的に1000円札の枚数は決まる
                num_1000 = y_5000 // 1000
                y_1000 = y_5000 - 1000 * num_1000
                n_1000 = n_5000 - num_1000
                if y_1000 == 0 and n_1000 == 0 and num_10000 + num_5000 + num_1000 == N:
                    result_10000, result_5000, result_1000 = num_10000, num_5000, num_1000
                    found = True
                    break
            if found:
                break
        if found:
            break
    
print(result_10000, result_5000, result_1000)

Submission status: Runtime Error

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

N, Y = map(int, input().split())
result_10000, result_5000, result_1000 = -1, -1, -1
found = False

# 効率を考えて、1万円札 → 5000円札 → 1000円札の順で求める
# 1万円札の数をY//10000から一つずつ減らして調べていく
for num_10000 in reversed(range(0, Y//10000 + 1)):
    y_10000 = Y - 10000 * num_10000
    n_10000 = N - num_10000
    if y_10000 == 0 and n_10000 == 0:
        result_10000, result_5000, result_1000 = num_10000, 0, 0
        found = True
        break
    else:
        for num_5000 in reversed(range(0, y_10000//5000 + 1)):
            y_5000 = y_10000 - 5000 * num_5000
            n_5000 = n_10000 - num_5000
            if y_5000 == 0 and n_5000 == 0 and num_10000 + num_5000 == N:
                result_10000, result_5000, result_1000 = num_10000, num_5000, 0
                found = True
                break
            elif y_5000 < 0 or n_5000 < 0:
                break
            else:
                # 10000円札と5000円札の枚数が決まれば必然的に1000円札の枚数は決まる
                num_1000 = y_5000 // 1000
                y_1000 = y_5000 - 1000 * num_1000
                n_1000 = n_5000 - num_1000
                if y_1000 == 0 and n_1000 == 0 and num_10000 + num_5000 + num_1000 == N:
                    result_10000, result_5000, result_1000 = num_10000, num_5000, num_1000
                    found = True
                    break
            if found:
                break
    if found:
        break
    
print(result_10000, result_5000, result_1000)

Submission status: Runtime Error

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

print(str(a+1)"/"str(b)"/"str(c))

Submission status: Runtime Error

Solution code:
S = input()
S[0]= 2018
print("/".join(S))

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
ans=min(A,B)+min(C,D)
print(ans)

Submission status: Runtime Error

Solution code:
S=int(input())
S[3]='8'
print(S)

Submission status: Runtime Error

Solution code:
s = input()
s[3] = "8"
print(s)

Submission status: Runtime Error

Solution code:
n, Y = map(int,input().split())
x , y , z , e = '-1' , '-1' , '-1' , 0

def check(num,total):
  for i in range(num+1):
    for j in range(num+1):
      for k in range(num+1):
        if (i + j + k == num) and (10000 * i + 5000 * j + 1000 * k == total):
          x , y , z = str(i) , str(j) , str(k)
          return x + ' ' + y + ' ' + z
print(check(n,Y))

Submission status: Runtime Error

Solution code:
import itertools

N, Y = (int(x) for x in input().split())
for x, y in itertools.product(range(N+1), range(N+1)):
  z = N - x - y
  if 0 <= z and 10000*x + 5000*y + 1000*z == Y:
    print('{} {} {}'.format(x, y, z))
    break
if not(x + y + z == N and 10000*x + 5000*y + 1000*z == Y):      
  print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
import itertools

N, Y = (int(x) for x in input().split())
for x, y in itertools.product(range(N+1), range(N+1)):
  z = N - x - y
  if 0 <= z and 10000*x + 5000*y + 1000*z == Y:
    print('{} {} {}'.format(x, y, z))
    break

if not(x + y + z == N and 10000*x + 5000*y + 1000*z == Y):      
  print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
import itertools

N, Y = (int(x) for x in input().split())
for x, y in itertools.product(range(N+1), range(N+1)):
  z == N - x - y
  if 0 <= z and 10000*x + 5000*y + 1000*z == Y:
    print('{} {} {}'.format(x, y, z))
    break

if not(x + y + z == N and 10000*x + 5000*y + 1000*z == Y):      
  print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
def main():
    N, Y = map(int, input().split())
    if Y == 10000 * N:
        print(N, 0, 0)
        return

    for i in range(N+1):
        tmp = 0
        tmp += 10000 * i
        for j in range(N-i+1):
            _tmp = tmp
            _tmp += 5000 * j
            if (Y - _tmp > 0 and (Y-_tmp) == 1000 * (N-i-j)) or (Y == _tmp and i + j == N):
                print(i, j, N-i-j)
                return

    print(-1, -1, -1)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
s = input()
s[3]=8
print(s)

Submission status: Runtime Error

Solution code:
a = input()
a[3]='8'
print(a)

Submission status: Runtime Error

Solution code:
s = input()
s[3]='8'
print(s)

Submission status: Runtime Error

Solution code:
N,Y= map(int,input().split())
for i in range(N+1):
    for j in range(N+1-i):
        if (10000*i+5000*j+1000*(N-i-j))==Y:
            print(i,j,N-i-j)
            exit()
print(-1,-1,-1)

Submission status: Runtime Error

Solution code:
# solution ver.連想配列（つまり辞書）
N = int(input())
num = [0 for i in range(N)]   

dict1 = {}    # キーは入力値、値はそのキーがあれば１なければ０（ない値は対応するキーがそもそもないから、すべての値は１）
for i in range(N):
    dict1[input()] = 1
    
list1 = list(dict1.values())
print(len(list1))

Submission status: Runtime Error

Solution code:
s = list(map(str,input()))
s[3] = "8"
print(*s[0:3],"8",*s[4:],sep="")

Submission status: Runtime Error

Solution code:
s = str(input())
s[3] = "8"
print(s)

Submission status: Runtime Error

Solution code:
s = str(input())
s[3] = 8
print(s)

Submission status: Runtime Error

Solution code:
print(input()[:3]+'8'+input()[5:])

Submission status: Runtime Error

Solution code:
N,Y=map(int,input().split())
answer=-1,-1,-1
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            answer=x,y,z
            break
    break
print(*answer)

Submission status: Runtime Error

Solution code:
N,Y=map(int,input().split())
answer=-1,-1,-1
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            answer=x,y,z
            break
      	else:
  	        continue
    break
print(*answer)

Submission status: Runtime Error

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

a = 0

for i in range(N):
    for ii in range(N):
        for iii in range(N):
            ans = 10000 * i + 5000 * ii + 1000 * iii
            J = i + ii + iii
            if ans == Y and J == N:
                print(i,ii,iii)
                a += 1
                break
        if a != 0:
            break
    if a != 0:
        break

if a == 0:
    print(-1,-1,-1)

Submission status: Runtime Error

Solution code:
s = input();s[3] = "8";print(s)

Submission status: Runtime Error

Solution code:
n,y = map(int,input().split()) #n枚,y円
a = -1
b = -1
c = -1


for i in range(n+1):
    for j in range(n+1):
        k = n-i-j
        if i*10000+j*5000+k*1000 == y and k >= 0 :
            a = i
            b = j
            c = k
            break
print(a,b,c)

Submission status: Runtime Error

Solution code:
n,y = map(int,input().split()) #n枚,y円
a = -1
b = -1
c = -1


for i in range(n+1):
    for j in range(n+1):
        k = n-i-j
        if i*10000+j*5000+k*1000 == y and k >= 0 :
            a = i
            b = j
            c = k
print(a,b,c)

Submission status: Runtime Error

Solution code:
N,Y = map(int, input().split())
for i in range(N + 1):
    for l in range(N - i + 1):
            if 10000*i + 5000*l + 1000*(N - i - l) == Y:
                print(i ,l ,(N - i - l))
                exit()

print(-1 ,-1 ,-1)

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())
for i in range(n + 1):
    for j in range(n - i + 1):
        if i * 10000 + j * 5000 + (n - i - j) * 1000 == y:
            print(i, j, n - i - j)
            exit()
print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
N,Y = map(int, input().split())
for i in range(N + 1):
    for l in range(N - i):
            ans = 10000*i + 5000*l + 1000*(N - i - l)
            if ans == Y:
                print("{} {} {} ".format(i ,l  ,(N - i - l)))
                exit()

print(-1 ,-1 ,-1)

Submission status: Runtime Error

Solution code:
N,Y = map(int, input().split())
for i in range(N):
    for l in range(N):
            ans = 10000*i + 5000*l + 1000*(N - i - l)
            if ans == Y:
                print("{} {} {} ".format(i ,l  ,(N - i - l)))
                exit()

print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
# coding: utf-8

N, Y=(int(x) for x in input().split())

A = Y // 10000 #Yを越えない最大の10000円札の枚数
B = Y // 5000
C = Y // 1000

roop = 0
for i in range(A+1):
    if roop == 1:
        break
    for j in range(B+1):
        if i + j > N:
            break
        c = N - i - j #c:1000円札の枚数
        if 10*i + 5*j + c == Y//1000 and c >= 0:
            # a:10000円札、b:5000円札
            a = i
            b = j
            roop = 1
            break

if roop == 1:
    print("{0} {1} {2}".format(a, b, c))
else:
    a, b, c = -1, -1, -1
    print("{0} {1} {2}".format(a, b, c))

Submission status: Runtime Error

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

for x in range(N+1):
    for y in range(N-x+1):
        if x*10000 + y*5000 + (N-x-y)*1000 == Y:
            break
    else:
        continue
    break

if x*10000 + y*5000 + (N-x-y)*1000 == Y:
    print(x, y, (N-x-y))
else:
    print("-1, -1, -1")

Submission status: Runtime Error

Solution code:
N = int(input())
arr = [int(input()) for _ in range(N)]

print(len(set(arr)))

Submission status: Runtime Error

Solution code:
import sys
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 li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]

import bisect


N, H = mi()
A = [0]*N
B = [0]*N
for i in range(N):
    A[i], B[i] = mi()

B = sorted(B)
a = max(A)
m = bisect.bisect_left(B, a)
'''
s = 1
e = N
m = (s+e)//2
pre_m = 0
while True:
    m = (s+e)//2
    if B[m-1] > a:
        e = m
    elif B[m-1] <= a:
        s = m
    if s==e:
        m -= 1
        break
    #else:
        #break
    if e-s==1 and pre_m==m:
        break
    pre_m = m
'''
rem = H - sum(B[m:])
if rem >= 0:
    print((N-m)+rem//a+(rem%a==0))
else:
    for i in range(m, N):
        rem += B[i]
        if rem>=0:
            print(N-i)

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())
a = 0
b = 0
c = 0
for i in range(n + 1):
    for j in range(n - i + 1):
        if 10000 * i + 5000 * j + 1000 * (n - i - j) == y:
            a = i
            b = j
            c = n - i - j
            break
        else:
            pass
if a + b + c > 0:
    print(str(a), ' ', str(b), ' ', str(c))
else:
    print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
s = int(input())

print(s[0:3] + '8' +s[4:10] )

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    t = int(input())
    s = []
    for i in range(t):
        s.append(int(input()))
    print(len(set(s)))

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    t = int(input())
    s = set()
    for i in range(t):
        s.add(int(input()))
    print(len(s))

Submission status: Runtime Error

Solution code:
t = int(input())
s = set()
for i in range(t):
  s.add(int(input()))
print(len(s))

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())
for i in range(n + 1):
  for j in range(n + 1 -i):
    if 10000*i + 5000*j + 1000*(n - i -j) == y:
      print(i, j, n - i -j)
      break
  else:
    continue
  break
else:
  print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
for i in range(N+1):
  for j in range(N+1-i):
    if 10000*i + 5000*j + 1000*(N-i-j) == Y:
      print(i, j, N-i-j)
      break
  else:
    continue
  break
else: 
  print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
for i in range(N+1):
  for j in range(N+1-i):
    if 10000*i + 5000*j + 1000*(N-i-j) == Y:
      print(i, j, N-i-j)
      break
else: 
  print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
for i in range(N+1):
  for j in range(N+1-i):
    if 10000*i + 5000*j + 1000*(N-i-j) == Y:
      break
    print(i, j, N-i-j)
else: 
  print("-1 -1 -1")