TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x = int(input())
happy500 = (x // 500) * 1000
print(happy500)
happy5 = ((x % 500) // 5) * 5
print(happy5)
print(happy500 + happy5)

x = input()
happy500 = (x % 500) * 1000
happy5(500 - (x % 500) * x) % 5 * 5
print(happy500 + happy5)

X = input()
happier = (X % 500) * 1000
happy = ((X % 500) % 5) * 5
print(happier + happy)


x = int(input())
happy500 = (x // 500) * 1000
happy5 = ((x % 500) // 5) * 5
print(happy500 + happy5)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X = input()
coin500, X = divmod(X, 500)
coin5, X = divmod(X, 5)
print(1000 * coin500 + 5 * coin5)

X = input()
coin500, X = divmod(X, 500)
coin5, X = divmod(X, 5)
print(1000 * coin500 + 5 * coin5)

X = int(input())
coin500, X = divmod(X, 500)
coin5, X = divmod(X, 5)
print(1000 * coin500 + 5 * coin5)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x = input()

print(x//500*1000 + (x%500)//5*5)

x = int(input())
 
print(x//500*1000 + (x%500)//5*5)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
money = int(input())


n_500 = int(money//500)
n_5 = int((money - 500*n_500)//5)

happiness = 1000 * n_500 + n_5
print(happiness)

money = int(input())

 
n_500 = int(money//500)
n_5 = int((money - 500*n_500)//5)

happiness = 1000 * n_500 + 5 * n_5
print(happiness)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x = int(input())
a = int(x/500)
b = x - a
c = int(b/5)

print(1000*a + 5*c)



x = int(input())
a = int(x/500)
b = x - 500*a
c = int(b/5)

print(1000*a + 5*c)



Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
a = input()
b = 0
while a >= 500:
  a-=500
  b+=1000
while a >= 5:
  a-=5
  b+=5
print(b)

a = int(input())
b = 0
while a >= 500:
  a-=500
  b+=1000
while a >= 5:
  a-=5
  b+=5
print(b)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
n = int(input())
print(n%1000*5+n//500*1000)

n = int(input())
print(n%500//5*5+n//500*1000)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X = input()
print((X//500)*1000+((X-X//500)//5)*5)

Y = input()
X = int(Y)
A = (X//500)*1000
B = (X-X//500*500)
print(A+B)


Y = input()
X = int(Y)
A = (X//500)*1000
B = (X-X//500*500)//5*5
print(A+B)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
N=int(input())
Happoint=(N//500)*1000 + ((n%500)//5)*5
print(int(Happoint))

N=int(input())
Hapt=0
if(N>=5):
  Hapt=Hapt+(N//500)*1000 + ((N%500)//5)*5
else:
  Hapt=0
print(Hapt)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X = int(input())
n_500 = X / 500
n_5 = (X % 500) / 5
ans = 1000 * n_500 +  5 * n_5
print(int(ans))

X = int(input())
n_500 = X / 500
n_5 = (X % 500) / 5
ans = 1000 * n_500 +  5 * n_5
print(ans)

X = int(input())
n_500 = X // 500
n_5 = (X % 500) // 5
ans = 1000 * n_500 +  5 * n_5
print(int(ans))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
# -*- coding: utf-8 -*-
s = int(input())
happy = 0
if s >= 500:
    happy += 1000 * (s // 500)
    s = s % 500
if s >= 5:
    happy += 5 * (s // 500)

print(happy)


x = int(input())
ans = 0
if x >= 500:
    ans += x // 500 * 1000
    x -= x // 500 * 500
if x >= 5:
    ans += x // 5 * 5

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X = int(input())

Y = X%500
Z = (X-Y*500)%5

print(1000*Y+5*Z)

X = int(input())

Y = X//500
Z = (X-Y*500)//5

print(1000*Y+5*Z)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):

X = int(input())
count1 = int(X/500) 
print(count1)


deducation = X - count1 * 500

count2 = int(deducation / 5)
print(count2)


uresisa = count1 * 1000 + count2 * 5
print(uresisa)

# %%



X = int(input())
count1 = int(X/500) 
#print(count1)


deducation = X - count1 * 500

count2 = int(deducation / 5)
#print(count2)


uresisa = count1 * 1000 + count2 * 5
print(uresisa)

# %%


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x=int(input())

a=x/500
d=x%500
b=d%5

print(a*1000+b*5)

x=int(input())



a=x//500
d=x%500
b=d//5

print(a*1000+b*5)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X = int(input())
sen = X // 500
amari = X % 500
go = amari // 5
ans = sen * 1000 + gp * 5

X = int(input())
sen = X // 500
amari = X % 500
go = amari // 5
ans = sen * 1000 + go * 5
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X = int(input())

coin1 = X / 500
coin2 = (X % 500) / 5

print(coin1*1000 + coin2*5)

X = int(input())

coin1 = X / 500
coin2 = (X % 500) / 5

print(int(coin1*1000 + coin2*5))

X = int(input())

coin1 = int(X / 500)
coin2 = int((X % 500) / 5)

print(coin1*1000 + coin2*5)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
s=int(input())
h=0
while True:
    if s>=500:
        a=s//500
        h =1000*a
        s=s%500
        
    else:
        h += int(s)
        break
print(str(h))

s=int(input())
h=0
while True:
    if s>=500:
        a=s//500
        h +=1000*a
        s=s%500
        
    elif s>=5:
        a=s//5
        h +=5*a
        s=s%5
    else:
        break
    
print(str(h))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):

def main(inputs):
	x=int(inputs[0][0])
	n=x//500
	x-=n*500
	n1=x//5
	print(n*1000+n1*5)


if __name__=="__main__":
	inputs=getInputs()

	main(inputs)



def getIntList(inp):
	return [int(_) for _ in inp]


from sys import stdin
import sys
sys.setrecursionlimit(10**8)

def getInputs():
	inputs=[]
	for line in stdin:
		line=line.split()
		inputs.append(line)
	return inputs

def main(inputs):
	x=int(inputs[0][0])
	n=x//500
	x-=n*500
	n1=x//5
	print(n*1000+n1*5)


if __name__=="__main__":
	inputs=getInputs()

	main(inputs)


Verdicts: Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
#500-1000, 5-5

x = int(input())
fiveHundred = x//500
x -= fiveHundred
fives = x//5
print(fiveHundred*1000+fives*5)

x = int(input())
fiveHundred = x//500
x -= fiveHundred*500
fives = x//5
print(fiveHundred*1000+fives*5)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
N = int(input())
F = 0
FF = 0
while(N>5):
  if(N>500):
    F = N/500
  else:
    FF = N/5
print((F*2)+(FF))

N = int(input())
F=0
FF=0
FFF=0
FFFF = 0
if(N>=500):
    F=N/500
    FFF = int(F)
FFFF = (N-(500*FFF))
if(FFFF>5):
    FF=int(FFFF/5)
print((int(F)*1000)+FF*5)
    


Verdicts: Time Limit Exceeded

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X=int(input())
A=X//500
B=(X%500)//5
print(A*100+B*5)

X=int(input())
A=X//500
B=(X%500)//5
print(A*1000+B*5)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
s = input()
ss = int(s)

s_1000 = ss / 500
print(s_1000)
s_under = ss - 500*int(s_1000)
print(s_under)
s_5 = int(s_under) / 5
print(s_5)

s_sum = 1000*int(s_1000) + 5*int(s_5)

print(s_sum)


s = input()
ss = int(s)

s_1000 = ss / 500
s_under = ss - 500*int(s_1000)
s_5 = int(s_under) / 5

s_sum = 1000*int(s_1000) + 5*int(s_5)

print(s_sum)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x=int(input())
a=x//500
y=x-(500*a)
b=y//5
print(a*1000+b*1)


x=int(input())
a=int(x/500)
y=x-(500*a)
b=int(y/5)
print(a*1000+b*1)


x=int(input())
a=int(x/500)
y=x-(500*a)
b=int(y/5)
print(a*1000+b*5)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
fun main()
{
    var has = readLine()!!.toInt()
    var happiness = 0
    if (has > 500)
    {
        var _500 = has / 500
        happiness = _500 * 1000
        has = has - _500 * 500
    }
    if (has > 5)
    {
        var _5 = has / 5
        happiness += _5 * 5
    }
    print(happiness)
}

has = int(input())
canbe = 0
_500, has = divmod(has, 500)
canbe += _500 * 1000
_5, has  = divmod(has, 5)
canbe += _5 * 5
print(canbe)


Verdicts: Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
money = int(input())

max500 = money // 500
rem500 = money % 500

max5 = money // 5

happiness = max500 * 1000 + max5 * 5

print(happiness)


money = int(input())
 
max500 = money // 500
rem500 = money % 500
 
max5 = rem500 // 5
 
happiness = max500 * 1000 + max5 * 5
 
print(happiness)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
s = int(input())
count1=-1
count2=-1
while s>=0:
 s=s-500
 count1=count1 +1
s=s+500
print(count1)
if s==0:
  yasashisa=count1*1000
  print(yasashisa)
else:
   while s >=0:
     s=s-5
     count2=count2 +1
   yasashisa=count1*1000+count2* 5
   print(yasashisa)





s=int(input())
a= s//500
b=(s%500)//5
yasashisa=a*1000+b*5
print(yasashisa)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X = input()
tmp = X // 500
ans = tmp * 1000 + X % 500 - ((X % 500) % 5)
print(ans)

X = int(input())
tmp = X // 500
ans = tmp * 1000 + X % 500 - ((X % 500) % 5)
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
def main():
  n = int(input())
  
  a = int(n/500)
  b = n % 500
  
  c = b / 5
  d = b % 5
  
  glad = int(1000 * a + 5 * c)
  
  print(glad)
  
main()

def main():
  n = int(input())
  
  a = int(n/500)
  b = n % 500
  
  c = int(b / 5)
  d = b % 5
  
  glad = int(1000 * a + 5 * c)
  
  print(glad)
  
  
  
main()

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
n=int(input())
happy=0
def covid(num):
  if num==0:
    return 0
  else:
    fund=num//500
    num-=fund*500
    happy+=fund*1000
    happy+=num//5*5
    return happy
print(covid(n))

n=int(input())
def covid(num):
  if num==0:
    return 0
  else:
    happy=0
    fund=num//500
    num-=fund*500
    happy+=fund*1000
    happy+=num//5*5
    return happy
print(covid(n))

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
import math
test = input()
five_hundred = math.floor(test / 500) * 1000
five_happy = math.floor((test - five_hundred*500)/5) * 5
print(five_hundred + five_happy)

import math
test = input()
five_hundred = math.floor(test / 500) * 1000
five_happy = math.floor((test - five_hundred*500)/5) * 5


import math
numeric = int(input())
result = math.floor(numeric / 500)*1000
intermediate = numeric - math.floor(numeric / 500)*500
result = result + math.floor(intermediate / 5)*5
print(result)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X=int(input())
print(X//500*1000+(X-X//500)//5*5)


X=int(input())
print(X//500*1000+(X-X//500*500)//5*5)



Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x = int(input())

count_a = x// 500
x = x%500
x = x% 100
x = x%50
x = x%10
count_b = x // 5

print(count_a*1000+count_b*5)

x = int(input())

count_a = x // 500
x = x % 10
count_b = x // 5

print(count_a * 1000 + count_b*5)

x = int(input())

gold = x // 500
x -= gold * 500

bronze = x // 5

print(gold*1000 + bronze*5)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x = int(input())
x500 = x / 500
x5 = (x % 500) / 5
print(1000 * x500 + 5 * x5)


x = int(input())
x500 = x // 500
x5 = (x % 500) // 5
print(1000 * x500 + 5 * x5)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
n = int(input())
h = 0
while(n > 4):
  if n >= 500:
    h += 1000
  elif n >= 5:
    h += 5
    
print(h)

n = int(input())
h = 0
while(n > 4):
    if n >= 500:
        h += 1000
        n -= 500
    elif n >= 5:
        h += 5
        n -= 5
    

    
print(h)

Verdicts: Time Limit Exceeded

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
N=int(input());print((((1000)*(N//500))+(N-((1000)*(N//500)))//5)*5)

N=int(input());M=N//500;M*=1000;X=500*(N//500);N-=X;M+=(N//5)*5;print(M)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X=int(input())
g500=X//500
g5=(X%500)//5
print(g500*500+g5*5)

X=int(input())
g500=X//500
g5=(X%500)//5
print(g500*1000+g5*5)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
def coin(usr_input):
	return (int(usr_input / 500) * 1000) + (int((usr_input - int(usr_input / 500) * 500) / 5) * 5)

user_input = eval(input())
print((user_input // 500) * 1000 + ((user_input % 500) // 5) * 5)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X = int(input())
hap_yen = int(X / 500)
to_hap_yen = hap_yen * 1000
remain_X = X - (hap_yen * 500)
remain_hap_yen = (remain_X / 5) * 5
total_hap_yen = to_hap_yen + remain_hap_yen
print(int(total_hap_yen))

X = int(input())
if X>=500:
    hap_yen = int(X / 500)
    to_hap_yen = hap_yen * 1000
    remain_X = X - (hap_yen * 500)
    remain_hap_yen = int(remain_X / 5)
    remain_hap_yen1=remain_hap_yen*5
    total_hap_yen = to_hap_yen + remain_hap_yen1
    print(int(total_hap_yen))
else:
    hap_yen=int(X/5)
    total_hap_yen=hap_yen*5
    print(total_hap_yen)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X = int(input())

if X >= 0 and X <= 10 ** 9:
    while True:
        if X >= 500:
            C = X // 500
            X = X - (500 * C)
        elif X >= 5:
            D = X // 5
            X = X - (5 * D)
        else:
            break

total = (500 * C) + (5 * D)

print(total)

X = int(input())

a = 0
b = 0
c = 0
d = 0
e = 0
f = 0

for q in range(100):
    for w in range(100):
        for e in range(100):
            for r in range(100):
                for t in range(100):
                    for y in range(100):
                        num = (500 * q) + (100 * w) + (50 * e) + (10 * r) + (5 * t) + (1 * y)
                        if X % num == 0:
                            m = q
                            i = t
                            break


print(500 * m + 5 * i)

X = int(input())

while True:
    if X >= 500:
        C = X // 500
        X = X - (500 * C)
    elif X >= 5:
        D = X // 5
        X = X - (5 * D)
    else:
        break

total = (500 * C) + (5 * D)

print(total)

X = int(input())
total = 0

C = 0
D = 0

while True:
    if X > 500:
        C = X // 500
        P = 500 * C
        X = X - P
    elif X > 5:
        D = X // 5
        L = 5 * D
        X = X - L
    else:
        break

total = (1000 * C) + (5 * D)

print(total)
print()

X = int(input())

C = 0
D = 0

if X >= 500:
    C = X // 500
    X = X - (500 * C)
if X >= 5:
    D = X // 5

total = (1000 * C) + (5 * D)

print(total)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
n = int(input())
ans = n // 500 * 1000
n //= 500
ans += n // 5 * 5
print(ans)

n = int(input())
ans = n // 500 * 1000
n %= 500
ans += n // 5 * 5
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X = int(input())
if X % 5 ==0 and X > 500:
        print(X*2)
elif X > 500 and not X % 5 == 0:
    A = X // 10
    A = A*10
    print(A*2)
elif X < 500 and not X % 5 ==0:
    print(X)
elif X < 5:
    print(0)

X = int(input())
if X % 5 ==0 and X > 500:
        print(X*2)
elif X > 500 and not X % 5 == 0:
    A = X // 10
    A = A*10
    print(A*2)
elif X < 500 and not X % 5 ==0:
    print(X)
elif X <= 5:
    print(X)
elif X < 5:
    print(0)

X = int(input())
print((X // 500) * 1000 + ((X % 500) // 5) * 5)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x = int(input())
point = 0
while x != 0:
    if x >= 50:
        result = x / 50
        summ = (50 * result)*2
        point = point + summ
        remain = x % 50
        x = remain
    if x >= 5:
        result = x / 5
        summ = 5 * result
        point = point + summ
        break;
print(point)

x = int(input("enter "))
point = 0
while x != 0:
    if x >= 50:
        result = x / 50
        summ = (50 * result)*2
        point = point + summ
        remain = x % 50
        x = remain
    if x >= 5:
        result = x / 5
        summ = 5 * result
        point = point + summ
        break;
print(point)

x = int(input())
point = 0
while x != 0:
    if x >= 500:
        result = x // 500
        summ = (500 * result)*2
        point = point + summ
        remainder = x % 500
        x = remainder
    if x >= 5:
        result = x // 5
        summ = 5 * result
        point = point + summ
        break;
print(point)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
s = int(input())
a = s // 500
b = s % 500
c = b // 5
print(a, c)
print(a * 1000 + c * 5)


s = int(input())
a = s // 500
b = s % 500
c = b // 5
print(a * 1000 + c * 5)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
# -*- coding: <encoding name> -*-

x = int(input())
print(1000 * (x // 500) + (x % 500) // 5)

# -*- coding: <encoding name> -*-

x = int(input())
print(1000 * (x // 500) + 5 * (x % 500))

# -*- coding: <encoding name> -*-

x = int(input())
print(1000 * (x // 500) + 5 * (x % 500 // 5)

# -*- coding: <encoding name> -*-

x = int(input())
print(1000 * (x // 500) + (x % 500))

# -*- coding: <encoding name> -*-

x = int(input())
print(1000 * (x // 500) + 5 * (x % 500 // 5))

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
n = int(input())
s=n//500
r=n%500
r=r//5
print(s*1000+r)


n = int(input())
s=n//500
r=n%500
print(r)
r=r//5
print(s*1000+r*5)

n = int(input())
s=n//500
r=n%500

r=r//5
print(s*1000+r*5)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X = int(input())

i = 0

while X >= 500:
  X -= 500
  i += 1
  


ans = 1000*i + X

print(ans)



X = int(input())

i = 0

while X >= 500:
  X -= 500
  i += 1
  
a = 0
while X >= 5:
  X -= 5
  a += 1

ans = 1000*i + 5*a

print(ans)



Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):

KN = input("").split()
A = input("").split()

K = int(KN[0])
N = int(KN[1])
A_0 = int(A[0])
A_N = int(A[N-1])
L = A_0

for j in range(N):
    A_i = int(A[j+1])
    A_m = int(A[j])
    if A_i - A_m > L:
        L == A_i - A_m

if L > K - A_N + A_0:
    print(K-L)
else:
    print(K - A_N + A_0)




X = int(input(""))

X500 = X//500
X_a = X%500

X5 = X_a//5

happy = X500*1000 + X5*5

print(happy)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
a = int(input())
b = a/500
c = b%500
d = c/5
print(b+d)

a = int(input())
b = int(a/500)*1000
c = a%500
d = int(c/5)*5
print(b+d)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
N = int(input())

print(N/500*1000+N%500/5*5)

N = int(input())
print(N//500*1000+N%500//5*5)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X=int(input())
cnt=0
n=X//1200
X-=n*1200
cnt+=n*1200*2
n=X//5
cnt+=n*5
print(cnt)

X=int(input())
cnt=0
n=X//500
X-=n*500
cnt+=n*1000
n=X//5
cnt+=n*5
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x = int(input())

a = x//500
x %= 500
b = x//5

print(a*1000 + b)

x = int(input())

a = x//500
x %= 500
b = x//5

print(a*1000 + b*5)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x = int(input())

num_500 = x / 500

amari = x - num_500

num_5 = int(amari / 5)

print(1000 * num_500 + 5 * num_5)

x = int(input())

num_500 = x / 500

amari = x - num_500

num_5 = amari / 5

print(1000 * num_500 + 5 * num_5)

x = int(input())

num_500 = int(x / 500)

amari = x - num_500

num_5 = int(amari / 5)

print(1000 * num_500 + 5 * num_5)


x = int(input())

num_500 = int(x / 500)

amari = x - 500 * num_500

num_5 = int(amari / 5)

print(1000 * num_500 + 5 * num_5)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X = 0

happiness500 = int(X / 500)
happiness5 = int((X%500/5))

print(happiness500*1000+happiness5*5)

X = int(input())

happiness500 = int(X / 500)
happiness5 = int((X%500/5))

print(happiness500*1000+happiness5*5)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
import math


num = int(input("num: "))


c_500 = math.floor(num / 500)
num2 = num - c_500 * 500

c_5 = math.floor(num2/5)



print(c_500 * 1000 +c_5 * 5)

import math


num = int(input())


c_500 = math.floor(num / 500)
num2 = num - c_500 * 500

c_5 = math.floor(num2/5)



print(c_500 * 1000 +c_5 * 5)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x = int(input())
 
a = x // 500
b = (x % 500) // 5
 
ans = a * 1000 + b * 5
 
 print(ans)

x = int(input())

a = x // 500

b = (x % 500) // 5
 
ans = a * 1000 + b * 5
 
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x = int(input())

happy = 0

a = int(x/500)
happy = a*1000

a = x-(a*500)
happy += a*5

print(happy)


x = int(input())

happy = 0
a = int(x/500)
happy = a*1000
a = int((x-(a*500))/5)
happy += a*5

print(happy)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x = input()

500yen = x//500*1000
5yen = (x - x//500)//5*5

print(500yen + 5yen)

x = int(input())

500yen = x//500*1000
5yen = x%500//5*5

print(500yen + 5yen)


x = int(input())

a = x//500*1000
b = x%500//5*5

print(a+b)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X=int(input())
N=0
n=0
N=X//500
n=(X-N*500)//5
input(N*1000+5*n)

X=int(input())
N=0
n=0
if X==0:
    print(0)
else:
    N=X//500
    n=(X-N*500)//5
    print(N*1000+5*n)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
X = int(input())
x1 = X%500
x2 = x1%5
print(x1*1000+x2*5)

X = int(input())
x1 = X//500
x2 = (X%500)//5
print(x1*1000+x2*5)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
N = int(input())
div,mod = divmod(N,5000)
div2 = (mod,5)
print(5000*div + 5*div2) 

N = int(input())
div,mod = divmod(N,500)
div2 = mod//5
print(1000*div + 5*div2) 

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves gold coins. He gains 1000 _happiness points_ for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)  Takahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?  (We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)

Submission attempts (in order):
x = int(input())
y = x % 500
print(x // 500 + y // 5)


x = int(input())
y = x % 500
print(x // 500 * 1000 + y // 5 * 5)


Verdicts: Wrong Answer

Accepted