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:
N, H = map(int, input().split())
a_list = []
b_list = []
for i in range(N):
    a, b = map(int, input().split())
    a_list.append(a)
    b_list.append(b)
count = 0
a = max(a_list)
b_list.sort()
while True:
    if len(b_list) >= 1:
        if b_list[-1] >= a:
            b = b_list.pop(-1)
            H -= b
            count += 1
            if H <= 0:
                break
        else:
            H -= a
            count += 1
            if H <= 0:
                break
    else:
        H -= a
        count += 1
        if H <= 0:
            break
        
print(count)

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
counter = True
for i in range(N+1):
    for j in range(N - i+1):
        if j >= 0 and (N-i-j) >= 0 and counter:
            if 10**4*i + 5*10**3*j + 10**3*(N-i-j) == Y:
                #print(str(i)+" "+str(j)+" "+str(N-i-j))
                print(i, j, N-i-j)
                counter = False
        else:
            break
if counter:
    print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
for x in range(n+1):
    for y in range(n+1-x):
        if 10000*x+5000*y+1000*(n-x-y)==m and x+y+(n-x-y)==n:
            print(x,y,(n-x-y))
            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):
            if  10000 * i + 5000 * j + 1000 * k == y:
                print(i, j, n - i - j)
                exit()
                    
print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
def solve():
    n, y = map(int, input().split())
    y = y // 1000
    for nogu in range(n+1):
        for higu in range(n + 1 - nogu):
            yuki = n - higu - nogu
            total = yuki*10 + higu*5 + nogu
            if total == y:
                print(yuki, higu, nogu)
                return
    print("-1 -1 -1")

solve()

Submission status: Runtime Error

Solution code:
n = int(input())
list_d=[input() for i in range(n)]
new_list_d = set(list_d)
sum1 = len(list(new_list_d))
print(sum1)

Submission status: Runtime Error

Solution code:
n = int(input())
list_d = list(map(int, input().split()))
new_list_d = set(list_d)
sum1 = len(list(new_list_d))
print(sum1)

Submission status: Runtime Error

Solution code:
#coding:utf-8
s=input()
s.replace(2017,2018)
print(s)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# [2,2,4,5] = [3,3,3]
# 重複を排除したときの要素の数がその段数となる

def getElementNum(N,a):    
    """ 
    >>> getElementNum(4,[2,4,6,8])
    4
    """
    b = list(set(a))
    return len(b)

def main():
    N = int(input())
    a = []
    for i in range(N):
        a.append( int( input() ) )
    result = getElementNum(N,a)
    print(result)

if __name__ == '__main__':
    main()

# if __name__ == '__main__':
#    import doctest
#     doctest.testmod()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = int(input().split('/'))

print("2018/"+S[1]+'/'+S[2])

Submission status: Runtime Error

Solution code:
def calculate_money():
    input_list = input().split()
    N = int(input_list[0])
    Y = int(input_list[1])

    for x_num in range(0, N + 1):
        for y_num in range(0, N + 1 - x_num):
            z_num = N - x_num - y_num
            if 10000 * x_num + 5000 * y_num + 1000 * z_num == Y:
                print(x_num, " ", y_num, " ", z_num)
                return


if __name__ == '__main__':
    calculate_money()

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(0, n+1):
	for j in range(0, n+1-i):
        k = n - (i + j)
        sum_price = 10000*i + 5000*j + 1000*k
        if n == i + j + k and sum_price == y:
            print(i, j, k)
            exit()
print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
# https://abc085.contest.atcoder.jp/tasks/abc085_d

from math import ceil
from operator import itemgetter
from itertools import chain


def trans(lst):
    return ((int(lst[0]), False), (int(lst[1]), True))

a,b = map(int, input().split())
data = list(chain.from_iterable([trans(input().split()) for _ in range(a)]))
data.sort(key=itemgetter(0), reverse=True)

count = 0
while b > 0:
    if data[0][1]:
        b -= data.pop(0)[0]
        count += 1
        continue
    else:
        count += ceil(b/data[0][0])
        break
print(count)

Submission status: Runtime Error

Solution code:
# https://abc085.contest.atcoder.jp/tasks/abc085_d

from operator import itemgetter
from itertools import chain

def trans(lst):
    return ((int(lst[0]), False), (int(lst[1]), True))

a,b = map(int, input().split())
data = [*chain.from_iterable([trans(input().split()) for _ in range(a)])]
data.sort(key=itemgetter(0), reverse=True)

count = 0
while b > 0:
    if data[0][1]:
        b -= data.pop(0)[0]
        count += 1
        continue
    else:
        count += int(b/data[0][0])
        break
print(count)

Submission status: Runtime Error

Solution code:
import sys

num,total = map(int,input().split())

if(total/10000 > num):
    mannum = num
else:
    mannum = total//10000

if(total/5000 > num):
    gosennum = num
else:
    gosennum = total//5000

for i in range(mannum+1):
    for j in range(max(1,min([num - i,gosennum+1]))):
        if(10000*i + 5000*j + 1000*(num-i-j) == total):
            print(i,j,(num-i-j))
            sys.exit()
print("-1 -1 -1")

Submission status: Runtime Error

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

ss = ''
 
for i in s:
  ss = ss + i
  
print(ss)

Submission status: Runtime Error

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

for X in range(N+1):
    for Y in range(N+1):
        if(X +Y > N):
            break
        elif(10000*X+5000*Y+1000*(N-X-Y) == yen):
            print(str(X)+" "+str(Y)+" "+" "+str(N-X-Y))
            exit()
                       
print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
s = list(str(input()))

s[3] = 8

t = ''
for i in range(len(s)):
  t = t + s[i]
  
print(t)

Submission status: Runtime Error

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


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
input_dict = {} 
for i in range(N):
    a = int(input())
    input_dict[a] = 1

print(len(input_dict))

Submission status: Runtime Error

Solution code:
n=int(input())
a=[]
t=1
for i in range(n):
    a.append(int(input()))
a.sort()
for i in range(n-1):
    if a[i]<a[i+1]:
        t+=1
print(t)

Submission status: Runtime Error

Solution code:
n=int(input())

d=[]

for i in range(n):
    d.append(int(input()))

k=0


for i in range(n-1):

    for j in range(i+1,n):
        if d[i]==d[j]:
            j -= 1
            break

    if j == n-1:
        k += 1
k += 1

print(k)

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())
res = [-1, -1, -1]
for a in range(n + 1):
    for b in range(n - a + 1):
        if 10000 * a + 5000 * b + 1000 * (n - a - b) == y:
            res[0] = a
            res[1] = b
            res[2] = n - a - b
print(' '.join(map(str, res)))

Submission status: Runtime Error

Solution code:
s=input()
s="2018"+s[4:]
print s

Submission status: Runtime Error

Solution code:
d=input()
print(d.repalace('7/','8/'))

Submission status: Runtime Error

Solution code:
d=input()
print(f'{d[:3]}8{d[4:]}')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=input()
if a[3]!="8":
    a[3]="8"
    print(a)
else:
    print(a)

Submission status: Runtime Error

Solution code:
a=input()
if a[3]!=8:
    a[3]=8
    print(a)
else:
    print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,h = (int(i) for i in input().split())
x = [[int(i) for i in input().split()] for i in range(n)]
a,b = 0,[]
for j in x:
	if a < j[0]: a = j[0]
	b.append(j[1])
num = 0
for j2 in b:
	if j2 >= a:
		h -= j2
		num +=1
if h%a==0: answer = (h-h%a)//a + num
else: answer = (h-h%a)//a + num + 1
print(answer)

Submission status: Runtime Error

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

a=[]
for i in range(N+1):
    for j in range(N-i+1):
        if 1000*i+5000*j+10000*(N-i-j)==Y:
            a.append(str(N-i-j))
            a.append(str(j))
            a.append(str(i))
    if len(a)!=0:
        break


if len(a)!=0:
    print(a[0]+' '+a[1]+' '+a[2])
else:
    print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
2017/01/07

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
n=int(input())
a=[]

for i in range(n):
	b=0
	b=int(input())
	a.append(b)

a=sorted(a)
c=0
for j in range(n-1):
	if((a[j])<(a[j+1])):
		c+=1

print(c+1)

Submission status: Runtime Error

Solution code:
def bills(count, value):
    max10000 = value // 10000
    for i in range(max10000 + 1):
        max5000 = min(count - i, (value - i * 10000) // 5000)
        for j in range(max5000 + 1):
            k = (value - i * 10000 - j * 5000) // 1000
            if i + j + k == count:
                return i, j, k
    
    return -1, -1, -1

v = bills(*map(int, input().split()))
print("{} {} {}".format(*v))

Submission status: Runtime Error

Solution code:
import sys

def bills(count, value):
    max10000 = value // 10000
    for i in range(max10000 + 1):
        max5000 = min(count - i, (value - i * 10000) // 5000)
        for j in range(max5000 + 1):
            k = (value - i * 10000 - j * 5000) // 1000
            if i + j + k == count:
                return i, j, k
    
    return -1, -1, -1

v = bills(int(sys.argv[1]), int(sys.argv[2]))
print("{} {} {}".format(*v))

Submission status: Runtime Error

Solution code:
import sys

N, Y = [int(s) for s in sys.stdin.readline().split(" ")]
Y2 = (Y/1000)-5*N

for z in range(0, 2001):
  x = (5*z-Y2)/4
  
  if x < 0:
    continue
  
  if int(x)-x==0:
  	x = int(x)
  	y = N-x-z
  	if y<0:
  		continue
  	
  	print(z, y, x)
  	exit(0)
  
  
print("-1 -1 -1")
exit(0)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c=map(string,input().split("/"))
print("2018/"+b+"/"+c)

Submission status: Runtime Error

Solution code:
N = int(input())
list_mochi = []
for i in range(N):
    r = int(input())
    if not(r in list_mochi):
        list_mochi += [r]

print(len(list_mochi))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n,y = map(int,input().split())
for i in xrange(n+1):
    for j in xrange(n-i+1):
        k = n-i-j
        if y == 10000*i + 5000*j + 1000*(k):
            print('{0} {1} {2}'.format(i,j,k))
            exit()
print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n,y = map(int,input().split())
for i in range(n+1):
    for j in range(n-i+1):
        k = n-i-j
        if y == 10000*i + 5000*j + 1000*(k):
            print('{0} {1} {2}'.format(i,j,k))
            exit()
print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
import numpy as np
import sys

flag = True
while (flag):
	input_line = sys.stdin.readline()
    if not input_line:
      break

    input_line[0:3] = '2018'
	print(input_line)

Submission status: Runtime Error

Solution code:
mochi_list = []
N = int(input())

for i in range(N):
    mochi_list.append(int(input()))

last_mochi = 101
count = 0

for mochi in sorted(mochi_list, reverse=True):
    if mochi < last_mochi:
        count += 1
    last_mochi = mochi

print(count)

Submission status: Runtime Error

Solution code:
N, Y = [int(i) for i in input().split()]


def f(x, y, z):
    return 10000 * x + 5000 * y + 1000 * z


def b():
    for x in range(N):
        for y in range(N):
            z = N - x - y
            if z < 0:
                continue
            if f(x, y, z) == Y:
                print('{0} {1} {2}'.format(x, y, z))
                return
    print('-1 -1 -1')
    return

b()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#coding : utf-8

N,Y = [int(i) for i in input().split()]
flag = 0

for i in range(N+1):
    for j in range(N+1-i):
        if Y == 10000*i + 5000*j + 1000*(N-i-j) and flag == 0:
            print(i,j,N-i-j)
            flag = 1
            break
if flag == 0:
    print(-1,-1,-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

# Y = 10000*x + 5000*y + 1000*z
# N = x + y + z
flag = 0
x = 0
y = 0
z = 0

if Y % 1000 != 0:
   flag = 1
elif Y > 10000*N:
   flag = 1
elif Y % 10000 == 0:
   x = Y//10000
else :
   x = Y//10000
   while True:
      for y in range(N-x+1):
         z = N-x-y
         if Y == 10000*x + 5000*y + 1000*z:
            flag = -1
            break
      if flag == -1:
         break
      elif x ==0:
         flag = 1
         break
      x = x-1
      
            

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

else :
   print(str(x)+" "+str(y)+" "+str(z))

Submission status: Runtime Error

Solution code:
#枚数
paper = int(input())

#餅リスト
moti_list  = []
li_uniq    = []

#取得
for w in range(paper):
    paper = int(input())

    moti_list.append(paper)

print(len(moti_list))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
ipts = [input() for i in range(N)]
dic = {}
for i in ipts:
    if(i not in dic):
        dic[i] =  True
print(len(dic))

Submission status: Runtime Error

Solution code:
N, H = input().strip().split(' ')
N, H =[int(N),int(H)]
L =list()
for i in range(0,N):
    X, Y = input().strip().split(' ')
    X, Y =[int(X), int(Y)]
    L.append([X,Y])

L0 = list()
for i in range(0,N):
    L0.append(L[i][0])

L1 = list()
for i in range(0,N):
    L1.append(L[i][1])

M = max(L0)
L2 = list()

for i in range(0,N):
    if L1[i] > M:
        L2.append(L1[i])

L2 = sorted(L2)

count = 0

for i in range(0,len(L2)):
    H -= L2[i]
    count += 1
    if H <= 0:
        print(count)
        break

if H > 0:
    if H % M ==0:
        count += H//M
        print(count)
    else:
        count += H//M + 1
        print(count)

Submission status: Runtime Error

Solution code:
import numpy as np

import itertools

import math 
from collections import defaultdict as dd
def main():
    N, Y = map(int, input().split())
    a = int(Y/10000)

    if a*10000 == Y:
        print (a,0,0)
        return

    s = -1
    for k in range(a+1):
        b = N-k
        if b >= 0:
            for j in range(b+1):
                s = 10000*k+5000*j+1000*(b-j)
                if s == Y:
                    print (k,j,(b-j))
                    return

    if s != Y:
        print ('-1 -1 -1')



if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()

Submission status: Runtime Error

Solution code:
n = input()
print(input[:4] + "8" + [5:])

Submission status: Runtime Error

Solution code:
n = input()
print n[0:4]

Submission status: Runtime Error

Solution code:

n, y = map(int, input().split())

y = y // 1000
print(n, y)


def find_by_for(v, n):
    """
        the tuple by example
        ((0, 0, 0), (10, 5, 1), 100, 10)
    """
    queue = []
    queue.append(((0, 0, 0), (1, 5, 10), v, n))
    while queue:
        xs, fv, v, n = queue.pop()
        if v == 0 and n == 0:
            return "%d %d %d"%(xs[2], xs[1], xs[0])
        elif not fv or v <= 0 or n <= 0:
            pass
        else:
            queue.append((xs, fv[:-1], v, n))
            z = list(xs) 
            idx = len(fv) -1
            z[idx] +=1
            queue.append((tuple(z), fv, v - fv[idx], n -1))
    return "-1 -1 -1"

print(find_by_for(y, n))

Submission status: Runtime Error

Solution code:

n, y = map(int, input().split())

y = y // 1000
print(n, y)


def find_by_for(v, n):
    """
        the tuple by example
        ((0, 0, 0), (10, 5, 1), 100, 10)
    """
    queue = []
    queue.append(((0, 0, 0), (1, 5, 10), v, n))
    while queue:
        xs, fv, v, n = queue.pop()
        if v == 0 and n == 0:
            return "%d %d %d\n"%(xs[2], xs[1], xs[0])
        elif not fv or v <= 0 or n <= 0:
            pass
        else:
            queue.append((xs, fv[:-1], v, n))
            z = list(xs) 
            idx = len(fv) -1
            z[idx] +=1
            queue.append((tuple(z), fv, v - fv[idx], n -1))
    return "-1 -1 -1\n"

print(find_by_for(y, n))

Submission status: Runtime Error

Solution code:
n = int(input())
list = []
i = 0
for k in range(n):
    d = int(input())
    if d in list:
        pass
    else:
        list.append(d)
print(len(list))

Submission status: Runtime Error

Solution code:
d =[]
for i in range(input()):
    k= raw_input()
    if k not in d:
        d.append(k)
print len(d)

Submission status: Runtime Error

Solution code:
ny = input().split()
n = int(ny[0])
y = int(ny[1])

def solve(n,y):
    Y = y/1000
    p = int((Y - n) // 9)
    for v in range(p+1):
        if (Y - n - 9*v)%4 == 0:
            b = int((Y - n - 9*v)/4)
            c = int((Y - 10*v - 5*b))
            if c*b < 0:
                continue
            else:
                return str(v), str(b), str(c)


ans = solve(n,y)
if ans != None:
    print(' '.join(ans))
else:
    print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N, Y = map(int, input().split())

a = 0
for x in range(N+1): 
    for y in range(N-x+1):
        if (10000*x + 5000*y + 1000*(N-x-y)) == Y:
            print(str(x)+" "+str(y)+" "+str(N-x-y))
            a = 1
            break
        if a == 1:
            break
    if a == 1:
        break

if a != 1:
    print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
import math

inn = [int(x) for x in input().split()]
aa = []
bb = []
for i in range(inn[0]):
    tmp = [int(x) for x in input().split()]
    aa.append(tmp[0])
    bb.append(tmp[1])

maxaa = max(aa)
ba = [x for x in bb if x > maxaa]
sumba = sum(ba)
lenba = len(ba)
if sumba == inn[1]:
    print(lenba)
    exit()
elif sumba > inn[1]:
    count = lenba
    tot = sumba
    for b in sorted(ba):
        tot -= b
        if tot < inn[1]:
            print(count)
            exit()
        count -= 1
else:
    count = lenba + math.ceil((inn[1]-sumba)/max(aa))
    print(count)

Submission status: Runtime Error

Solution code:
S = int(input())

S_re = S.replace('2017', '2018')

print(S_re)

Submission status: Runtime Error

Solution code:
count=0
N=int(input())
d=[]
d=[int(input()) for i in range(N)]
for k in range (N-1):
    for j in range(k+1,N-1):
         dd1=d[k]
         dd2=d[j]
         if dd1==dd2 :break
    else:count+=1
print(count)

Submission status: Runtime Error

Solution code:
count=0
N=input()
d=[]
d=[int(input()) for i in range(int(N))]
for k in range (int(N)-1):
    dd1=d[k]
    dd2=d[k+1]
    if not dd1==dd2 :count+=1
print(count+1)

Submission status: Runtime Error

Solution code:
S = raw_input()

print('2018/01' + S[-2]

Submission status: Runtime Error

Solution code:
input = str(raw_input())

print("2018"+input[4:])

Submission status: Runtime Error

Solution code:
print("2018"+input[6:])

Submission status: Runtime Error

Solution code:
print(input[:3]+"8"+input[6:])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=input()
new=S.split('2017')
print('2018'+new)

Submission status: Runtime Error

Solution code:
new=S.split('2017')

Submission status: Runtime Error

Solution code:
new=S.split('2017')
print('2018'+new)

Submission status: Runtime Error

Solution code:
import sys
import math
s_ls = sys.stdin.read().split("\n")[:-1]
a = []
b = []
hp = int(s_ls[0].split()[1])
max_slash = 0
for element in s_ls[1:]:
    slash = int(element.split()[0])
    if slash > max_slash:
        max_slash = slash
    b.append(int(element.split()[1]))
bp = sorted([x for x in b if x > max_slash])[::-1]
count = 0
for e in bp:
    hp -= e
    count += 1
    if hp < 0:
        break
if hp > 0:
    count += math.ceil(hp / max_slash)

print(int(count))

Submission status: Runtime Error

Solution code:
import sys
import math
s_ls = sys.stdin.read().split("\n")[:-1]
if "" in s_ls:
    s_ls.remove("")
# print(s_ls)
a = []
b = []
hp = int(s_ls[0].split()[1])
max_slash = 0
for element in s_ls[1:]:
    slash = int(element.split()[0])
    if slash > max_slash:
        max_slash = slash
    # a.append(int(element.split()[0]))
    b.append(int(element.split()[1]))
# print(hp)
# print(max(a))
bp = sorted([x for x in b if x > max_slash])[::-1]
# print(max_slash, bp)
count = 0
for e in bp:
    hp -= e
    count += 1
    if hp < 0:
        break
if hp > 0:
    count += math.ceil(hp / max_slash)

print(count)
# max_slash = max([x.split()[0] for x in s_ls])
# print(max_slash)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
s = row_input()

b = s.split('/')

b[0].replace('7','8')


# 出力
print('/'.join(b))

Submission status: Runtime Error

Solution code:
a = input()
a[:4] = '2018'
print(a)

Submission status: Runtime Error

Solution code:
import sys
 
N, Y = [int(x) for x in sys.stdin.readline().strip().split()]
 
a = Y // 10000
b = (Y - a * 10000) // 5000
c = (Y - a * 10000 - b * 5000) // 1000
 
t = a + b + c
if N >= t + 9:
    l = (N - t - 9) // 9
    a -= l
    c += l * 10
 
t = a + b + c
if N >= t + 4:
    l = (N - t - 4) // 4
    b -= l
    c += l * 5
 
t = a + b + c
if N >= t:
    l = N - t
    a -= l
    b += l * 2
 
if a + b + c > N and a >= 0 and b >= 0 and c >= 0:
    print("-1 -1 -1")
else:
    print(a, b, c)

Submission status: Runtime Error

Solution code:
setting = input().rstrip().split(" ")
N = int(setting[0])
Y = int(setting[1])
otoshidama = [-1,-1,-1]

for x in range(N):
    for y in range(N):
        if 10000*x + 5000*y + 1000*(N-x-y) == Y :
            otoshidama = [x,y,N-x-y]
        else:
            pass

print(otoshidama[0]," ",otoshidama[1]," ",otoshidama[2])

Submission status: Runtime Error

Solution code:
setting = input().rstrip().split(" ")
N = int(setting[0])
Y = int(setting[1])


for x in range(N):
    for y in range(N):
        if 10000*x + 5000*y + 1000*(N-x-y) == Y :
            otoshidama = [x,y,N-x-y]
        else:
            pass

print(otoshidama[0]," ",otoshidama[1]," ",otoshidama[2])

Submission status: Runtime Error

Solution code:
S = raw_input()
S.replace("2017","2018")

print(S)

Submission status: Runtime Error

Solution code:
S = raw.input()
S = S.replace("2017","2018")

print(S)

Submission status: Runtime Error

Solution code:
S = raw.input()
S.replace("2017","2018")

print(S)

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
# x:10000円, y;5000円, z:1000円
for x in range(N+1):
    for y in range(N-x+1):# 5000円の枚数をN-(10000円の枚数)までに制限
        for z in range(N-x-y-1):
            if 10000*x + 5000*y + 1000*z == Y:
                print(x, y, z)
                exit(0)
print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
n,h = map(int,input().split())
a = []
b = []
for i in range(n):
	c,d = map(int,input().split())
	a.append(c)
	b.append(d)

total = 0
b.sort()
b.reverse()
counter = 0
am = max(a)
for i in b:
	if i >= am:
		total += i
		counter += 1
	else:
		break

if (h-total)%am == 0:
	print(counter+(h-total)//am)
else:
	print(counter+(h-total)//am+1)

Submission status: Runtime Error

Solution code:
print(''.join((lambda s:s[3]='8')(list(input()))))

Submission status: Runtime Error

Solution code:
import math

def main():
    N, H = map(int, input().split())

    cuts = []
    throws = []
    for i in range(N):
        tmp = [int(j) for j in input().split()]
        cuts.append(tmp[0])
        throws.append(tmp[1])

    max_cut = max(cuts)
    t1 = 0

    throws.sort(reverse=True)

    for throw in throws:
        if throw < max_cut:
            break
        H -= throw
        t1 += 1

    t2 = math.ceil(H / max_cut)

    print(t1 + t2)




main()

Submission status: Runtime Error

Solution code:
n=int(raw_input())
N=[]
for i in range(n):
	N.append(int(raw_input()))
N.sort()
ans=1
for i in range(1,n):
	if N[i]!=N[i-1]:
		ans+=1
print ans

Submission status: Runtime Error

Solution code:
N,Y = map(int,input().split())
Y = Y/1000
torf = False
for numoft in range(N+1):
    for numof5t in range(N-numoft+1):
        numof10t = (N)-(numoft+numof5t)
        if Y == numoft + 5*numof5t + 10*numof10t:
            print(numof10t,numof5t,numoft)
            exit()
print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
s=input()
s=s.split(' ')
maisuu = int(s[0])
maney  = int(s[1])

minn_man = int(maney/10000)+1
minn_sen = int(maney / 1000 )+1
minn_go  = int(maney / 5000) +1
flg=True
for man in range(0,minn_man):
	for go in range(0,minn_go):
		for sen in range(0,minn_sen):
			if man+go+sen == maisuu:
				if man*10000+ go*5000 + sen*1000 == maney:
					print(str(man)+","+str(go)+","+str(sen))
					flg=False
		if flg!=True:
			break
	if flg!=True:
		break
if flg:
	print('-1,-1,-1')

Submission status: Runtime Error

Solution code:
s=raw_input()
s=s.split(' ')
maisuu = int(s[0])
maney  = int(s[1])

minn_man = int(maney/10000)+1
minn_sen = int(maney / 1000 )+1
minn_go  = int(maney / 5000) +1
flg=True
for man in range(0,minn_man):
	for go in range(0,minn_go):
		for sen in range(0,minn_sen):
			if man+go+sen == maisuu:
				if man*10000+ go*5000 + sen*1000 == maney:
					print(str(man)+","+str(go)+","+str(sen))
					flg=False
		if flg!=True:
			break
	if flg!=True:
		break
if flg:
	print('-1,-1,-1')

Submission status: Runtime Error

Solution code:
R = lambda type_ = "int": list(map(eval(type_), input().split(' ')))

N, H = R()
a, b = 0, []
while N:
    a_, b_ = R()
    b.append(b_)
    a = max(a, a_)
    N -= 1

b.sort()
i = len(b) - 1
while i >= 0 and H > 0 and b[i] >= a:
    H -= b[i]
    i -= 1
    
if i < 0 and H > 0:
    print(len(b) + (H - 1) // a + 1)
elif H <= 0:
    print(len(b) - i - 1)
elif a > b[i]:
    print(len(b) - i - 1 + (H - 1) // a + 1)

Submission status: Runtime Error

Solution code:
def search(value, ten, five, one, num):
    global ans
    if ans or value < 0:
        return
    
    if value == 0 and (ten+five+one) == num:
        ans = (ten, five, one)
    search(value-10, ten+1,five,one, num)
    search(value-5, ten, five+1, one, num)
    search(value-1, ten, five,one+1,  num)

num, value = map(int, input().split())
value //= 1000
num_ten = 0
num_five = 0
num_one = 0
ans = None
if (num-1)*100 < value < num*100:
    print("-1 -1 -1")
else:
    search(value, num_ten, num_five, num_one, num)
    print(ans[0], ans[1], ans[2])

Submission status: Runtime Error

Solution code:
n, h = (int(s) for s in input().split())

a = []
b = []

for i in range(n):
    a_i, b_i = (int(s) for s in input().split())
    a.append(a_i)
    b.append(b_i)

a_max = max(a)
b.sort(reverse=True)

for i, b_i in enumerate(b):
    if b_i > a_max:
        h -= b_i
        if h <= 0:
            print(i + 1)
            break
    else:
        print(i + (h - 1) // a_max + 1)
        break
else:
    print(len(b) + (h - 1) // a_max + 1)

Submission status: Runtime Error

Solution code:
n = int(input())
mochi = [int(input()) for i in range(n)]
mochi.sort(reverse=True)

size = 0
max = 9999999999

for m in mochi:
    # print(m)
    if m < max:
        size += 1
        max = m
# 出力
print(size)

Submission status: Runtime Error

Solution code:
import math
N,H = map(int,input().split())

aList = []
bList = []
for count in range(0,N):
    a,b = map(int, input().split())
    aList.append(a)
    bList.append(b)

bList.sort()
bList.reverse()

maxA = max(aList)

count = 0
damage = 0
for b in bList:
    if maxA < b:
        damage+=b
        count+=1
    if damage >= H:
        break

if damage < H:
    remainingHP = H - damage
    count = count + math.ceil(remainingHP / maxA)

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

a = 0
b = 0
c = n
ans = c * 1000

while ans < y:
    if y - ans >= 9000:
        tmp = (y - ans) // 9000
        a += tmp
        c -= tmp
    elif y - ans >= 4000:
        tmp = (y - ans) // 4000
        b += tmp
        c -= tmp
    ans = a * 10000 + b * 5000 + c * 1000

if ans != y:
    a = b = c = -1

print(a, b, c)

Submission status: Runtime Error

Solution code:
N = input()
Y = input()
x = y = z = 0
z = N
while(1):
    if 10000*x+5000*y+1000*z == Y:
        print x,y,z
        break
    else:
        if z > 0:
            y += 1
            z -= 1
        elif y > 0:
            x += 1
            y = 0
            z =	N - x
        else:
            print -1, -1, -1
            break

Submission status: Runtime Error

Solution code:
s=input()
s=s.split(' ')
maisuu = int(s[0])
maney  = int(s[1])

minn_man = int(maney/10000)
minn_go  = int((maney%10000)/5000)
minn_sen = int((maney%5000)/1000)
flg = True
min_maisuu = minn_man+minn_go+minn_sen
if min_maisuu <= maisuu <= maney/1000:
	minn_go  = maney / 5000 +1
	minn_sen = maney / 1000 +1
	minn_man += 1

	for man in range(0,minn_man):
		for go in range(0,minn_go):
			for sen in range(0,minn_sen):
				if man+go+sen == maisuu:
					if man*10000+ go*5000 + sen*1000 == maney:
						print(str(man)+","+str(go)+","+str(sen))
						flg=False
if flg:
	print('-1,-1,-1')

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
date = input()
# 出力
print "2018" + date[4:]