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())
ans=0
if X>=500:
  ans+=X//500
  X=X-ans*500
if X>=5:
  ans+=X//5
print(ans)

X=int(input())
ans=0
if X>=500:
  ans+=(X//500)*1000
  X=X-(ans//1000)*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())
a = int((x//500)*1000)
b = int(((x-(x//500))//5)*5)
print(int(a+b))

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


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())

div = x//500
rem = x-div*500
res = div*1000 + (rem//5)*5

x = int(input())

div = x//500
rem = x-div*500
res = div*1000 + (rem//5)*5

print(res)

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()
num500=X//500
num5=(X%500)//5
print (1000*num500+5*num5)

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

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

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

Verdicts: Runtime Error

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('Enter Input: '))
if X > 5:
    a = int(X/500)
    b = X % 500
    c = int(b/5)
    d = a * 1000 + c * 5
    print(d)
else:
    print(0)

X = int(input('Enter Input: '))
if X in range(0, 10**9):
    if X > 500:
        a = int(X/500)
        b = X % 500
        c = int(b/5)
        d = a * 1000 + c * 5
        print(d)
    elif X <500 and X>5:
        a = int(X/5)
        d = a * 5
        print(d)

X = int(input())
if X>=0 and X<=10**9:
    a, b = divmod(X, 500)
    if X >= 500:
        c = int(b/5)
        d = int(a*1000) + c*5
        print(d)
    elif X >= 5 and X <500:
        c = int(X/5)*5
        print(c)
    else:
        print(0)

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=input()
a=x//500
b=(x%500)//5
print(1000*a+5*b)

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

x=int(input())
a=x//500
b=(x%500)//5
print(1000*a+5*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):
a=int(input())
n = math.floor(a/500)
total_price= n * 1000 + (a - n * 500)
print(total_price)

import math
a=int(input())
n = math.floor(a/500)
m = math.floor((a - n * 500)/5)
total_price= n * 1000 + m*5
print(total_price)

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())
ans = 0

ans += (x // 500) * 1000
x -= (x // 500) * 500
print(x, ans)
ans += (x // 5) * 5

x = int(input())
ans = 0

ans += (x // 500) * 1000
x -= (x // 500) * 500
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())
a = x//500
b = (x%500)//50

print(a*1000 + 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):
def registar(nyukin,coin):
    oturi=nyukin-coin*int(nyukin/coin)
    return oturi,int(nyukin/coin)

x,coin_500=registar(x,500)
#print(coin_500)
x,coin_5=registar(x,5)
x,coin_1=registar(x,1)

#print(coin_500,coin_5,coin_1)
uresisa=coin_500*1000+coin_5*5
print(uresisa)

x=int(input())

coin_1=0
coin_5=0
coin_500=0

def registar(nyukin,coin):
    oturi=nyukin-coin*int(nyukin/coin)
    return oturi,int(nyukin/coin)

x,coin_500=registar(x,500)
#print(coin_500)
x,coin_5=registar(x,5)
x,coin_1=registar(x,1)

#print(coin_500,coin_5,coin_1)
uresisa=coin_500*1000+coin_5*5
print(uresisa)

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())

a = X * 0.01 // 5 

pointa = a * 1000

b = X - a * 500


pointb = b // 5 * 5



print(pointa + pointb)

X = int(input())

a = X * 0.01 // 5 

pointa = a * 1000

b = X - a * 500


pointb = b // 5 * 5


z = round(pointa + pointb)
print(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())

gh = X//500
g = X%500//5

print(gh * 1000 + g * 1)

X = int(input())

gh = X//500
g = X%500//5

print(gh * 1000 + g * 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):
a=int(input())
b=a//500
c=(a-b)//5
print(1000*b+5*c)

a=int(input())
b=a//500
c=(a-b*500)//5
print(1000*b+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):
X = int(input())
print(X//500*1000+5*(X-500*(X//500))//5)

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

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())
print(print('{:.0f}'.format(round(X/500)*1000+round(rem(X/500)/5)*5)))

import math
X=int(input())
A=math.floor(X/500)*1000+math.floor(X%500/5)*5
print('{:.0f}'.format(A))

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):
    coin = int(input())
    fivet_yen = 0
    five_yen = 0
    if coin == 0:
        print(0)
    else:
    while(coin > 0):
        if coin >= 500:
            coin = coin - 500
            fivet_yen = fivet_yen + 1000
        else:
            if coin >= 5:
                coin = coin - 5
                five_yen   = five_yen + 5
            else:    
                coin = coin - 1


    print(fivet_yen + five_yen)
        
        
        

coin = int(input())
fivet_yen = 0
five_yen = 0
if coin == 0:
    print(0)
else:
   while(coin > 0):
    if coin >= 500:
        coin = coin - 500
        fivet_yen = fivet_yen + 1000
    else:
        if coin >= 5:
            coin = coin - 5
            five_yen   = five_yen + 5
        else:  
            coin = coin - 1
    print(fivet_yen + five_yen)


       
    
       

coin = int(input())
coin = coin * 2

if coin == 0:
    print(0)
else:
    print(coin)

coin = int(input())
fivet_yen = 0
five_yen = 0
if coin == 0:
    print(0)
else:
   while(coin > 0):
    if coin >= 500:
        coin = coin - 500
        fivet_yen = fivet_yen + 1000
    else:
        if coin >= 5:
            coin = coin - 5
            five_yen   = five_yen + 5
        else:  
            coin = coin - 1
   print(fivet_yen + five_yen)


       
    
       

Verdicts: Runtime Error

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())

res500 = X // 500
X %= 500
res5 = X // 5
print(res500 + res5)

X = int(input())

res500 = X // 500
X %= 500
res5 = X // 5
print(res500 * 1000 + res5 * 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 = input()
a=X//500
b=(X-500*a)//5
print(1000*a+5*b)

X = int(input())
a=X//500
b=(X-500*a)//5
print(1000*a+5*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):
Y = int(input())

C500 = Y // 500
C5 = (Y - C500*500) // 5 if (Y - C500*500) // 5>0 else 0

print(C500, C5)
print(C500*1000+C5*5)

Y = int(input())
 
C500 = Y // 500
C5 = (Y - C500*500) // 5 if (Y - C500*500) // 5>0 else 0

print(C500*1000+C5*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

N = int(input())
#print(N)

A = math.floor(N / 500)
#print(A)
N = N - A * 500
#print(N)
B = math.floor(N / 5)
print(B)

AA = A * 1000
BB = B * 5
print(AA + BB)

import math

N = int(input())
#print(N)

A = math.floor(N / 500)
#print(A)
N = N - A * 500
#print(N)
B = math.floor(N / 5)


AA = A * 1000
BB = B * 5
print(AA + BB)

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())

f = int(x / 500) * 1000

s = int((f % 500) / 5) * 5

print(f + s)


x = int(input())

f = int(x / 500) * 1000

s = int((x % 500) / 5) * 5

print(f + s)


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())

c_500 = x // 500
x = c_500 * 500
c_5 = x // 5

print(c_500 * 1000 + c_5 * 5)



x = int(input())
 
c_500 = x // 500
x = x - c_500 * 500
c_5 = x // 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):
n=int(input())
print(1000*(n/500)+((n%500))

n=int(input())
print(1000*(n//500)+5*((n%500)//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):
n=int(input())

ct = n // 1000

ost = n % 1000

ans = ct * 500 + (ost // 5) * 5

print(ans)

n=int(input())

ct = n // 500

ost = n - ct * 500

ans = ct * 1000 + (ost // 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())

a, b = divmod(x, 500)
c = b // 5

print(a + c)

x = int(input())
 
a, b = divmod(x, 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):
import math

X = int(input())
happy_1000 = X//500
X = math.floor(X%500)
print(X)
happy_5 = X//5
res = happy_1000*1000 + happy_5*5
print(res)

import math

X = int(input())
happy_1000 = X//500
X = math.floor(X/500)
happy_5 = X//5
res = happy_1000*1000 + happy_5*5
print(res)

import math

X = int(input())
happy_1000 = X//500
X = math.floor(X%500)
happy_5 = X//5
res = happy_1000*1000 + happy_5*5
print(res)

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 -*-

X = int(input())

a = int(X/500)
b = int((X-500*a)/5
print("{}".format(1000*a+5*b))


# -*- coding: utf-8 -*-

X = int(input())

a = int(X/500)
b = int((X-500*a)/5)
print("{}".format(1000*a+5*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):
money = int(input())
c_500 = money//500
c_5 = (money%500)/5
print(c_500*1000+c_5*5)

money = int(input())
c_500 = money/500
c_5 = (money%500)/5
print(1000*c_500+5*c_5)

money = int(input())
c_500 = money//500
c_5 = (money%500)//5
print(1000*c_500+5*c_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 = input(int())
a = x//500
b = (x%500)//5
h = a*1000+b*5
print(h)


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


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):
# coding: UTF-8
import os

def remove_empty(target_list: list):
    empty_removed_list = [x for x in target_list if x]
    return empty_removed_list

def get_stdin_str_list():
    input_str = input().strip()
    input_str_list = input_str.split()
    return input_str_list

def get_stdin_int_list():
    input_str_list = get_stdin_str_list()
    input_int_list = list(map(input_str_list, int))
    return input_int_list

X = get_stdin_int_list()[0]
n_500 = int(X / 500)
X = X % 500
n_5 = int(X/5)

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

# coding: UTF-8
import os

def remove_empty(target_list: list):
    empty_removed_list = [x for x in target_list if x]
    return empty_removed_list

def get_stdin_str_list():
    input_str = input().strip()
    input_str_list = input_str.split()
    return input_str_list

def get_stdin_int_list():
    input_str_list = get_stdin_str_list()
    input_int_list = list(map(input_str_list, int))
    return input_int_list

X = get_stdin_int_list()[0]
n_500 = int(X / 500)
X = X % 500
n_5 = int(X/5)

p = n_500*1000 + n_5*5

# coding: UTF-8
import os

def remove_empty(target_list: list):
    empty_removed_list = [x for x in target_list if x]
    return empty_removed_list

def get_stdin_str_list():
    input_str = input().strip()
    input_str_list = input_str.split()
    return input_str_list

def get_stdin_int_list():
    input_str_list = get_stdin_str_list()
    input_int_list = list(map(int, input_str_list))
    return input_int_list

X = get_stdin_int_list()[0]
n_500 = int(X / 500)
X = X % 500
n_5 = int(X/5)

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

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):
yen = int(input())

happy = 1000 * int(yen//500) + 5 * (yen - (500 * int(yen//500)))//5

print(happy)

yen = int(input())

happy = 1000 * int(yen//500) + 5 * int((yen - (500 * int(yen//500)))//5)

print(hap)py)


yen = int(input())

happy = 1000 * int(yen//500) + 5 * int((yen - (500 * int(yen//500)))//5)

print(happy)


Verdicts: Wrong Answer

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())
cnt = 0
q = x // 500
cnt += (q * 1000)
w = x % 500
e = w // 5
cnt += (e * 5)


x=int(input())
cnt = 0
q = x // 500
cnt += (q * 1000)
w = x % 500
e = w // 5
cnt += (e * 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):
all_money = int(input())

big_cnt = 0
sml_cnt = 0

all_money_mod = all_money

while(all_money_mod >= 500):
  print(all_money_mod)
  all_money_q = all_money // 500
  all_money_mod = all_money % 500
  
  big_cnt += all_money_q
  
  if all_money_mod < 500:
    break
  
  all_money = all_money_mod

all_money = all_money_mod
  
while(all_money_mod >= 5):
  all_money_q = all_money // 5
  all_money_mod = all_money % 5
  
  sml_cnt += all_money_q
  
  if all_money_mod < 5:
    break
  
  all_money = all_money_mod
  
hapiness = big_cnt * 1000 + sml_cnt * 5
print(hapiness)

x= int(input())


quot = x//500
rem = x%500

print((1000 * quot) + (rem//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=input()
x1=int(x) 


r=x1/500
x2=x1%500


r1=x2/5
x3=x2%5

sam=(r*1000)+(r1*5)

print("sam")















x=input()
x1=int(x) 


r=x1/500
x2=x1%500


r1=x2/5
x3=x2%5

sam=(r*1000)+(r1*5)

print(sam)








x=input()
x1=int(x) 


r=int(x1/500)
x2=x1%500


r1=int(x2/5)
x3=x2%5

sam=(r*1000)+(r1*5)

print(sam)


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())
temp=0
temp+=(s//500)*1000
s=s//500
temp+=(s//5)*5
print(temp)

s=int(input())
temp=0
temp+=(s//500)*500
s=s//500
temp+=(s//5)*5
print(temp)

s=int(input())
temp=0
temp+=(s//500)*1000
s=s%500
temp+=(s//5)*5
print(temp)

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())
print((X//500)*2+(X%500)//5)

X=int(input())
print((X//500)*1000+(X%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=input()
y=int(X)
while y<1000:
  y-=1000
  z+=1
result=z*2+y*1
str_result=str(result)
print('str_result')

X=input()
y=int(X)
z=0
while y>=1000:
  y-=1000
  z+=1
result=z*2+y*1
str_result=str(result)
print(str_result)

X=input()
y=int(X)
z=0
while y>=500:
   y-=500
   z+=1
a=0
while y>=5:
    y-=5
    a+=1
   
result=z*1000+a*5
str_result=str(result)
print(str_result)

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):
x = int(input())
Y = [500, 100, 50, 10, 5, 1]
ans = 0
for i in Y:
    if i == 500:
       ans +=  (x // i)*1000
    elif i == 5:
        ans +=  (x // i)*5
    x -= (x//i)*i
    if x == 0:
        break
print(ans)

x = int(input())
a = x//500
x -= 500*a
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=input()
print(((x//500)*1000)+((x%500//5)*5))

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

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):
n = int(input())
print(int(n / 500) * 1000 + int((n % 500) / 5))

n = int(input())
print(int(n / 500) * 1000 + int((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 = input()
bigpleasure = x//500*1000
smallpleasure = x%500//5*5

print(bigpleasure+smallpleasure)

x = int(input())
bigpleasure = (x//500)*1000
smallpleasure = ((x%500)//5)*5

print(bigpleasure+smallpleasure)

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())

ans = x//500

ans_2 = (x-x%500)//5

print(ans**1000+ans_2*5)

x = input()

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


x = int(input())

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

x = int(input())

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

Verdicts: 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):
x=int(input())
a = x // 500
x %= 500
b = x // 5
print(a+b)

def main():
    x=int(input())
    a = x // 500
    x %= 500
    b = x // 5
    print(1000*a+5*b)

if __name__=='__main__':
    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):
a = int(input())
b = a / 500
c = b * 1000
d = (a % 500) / 5
e = d * 5
print(c + e)

X = input()
X = int(X)
if 0 <= X and X <= 10**9:
  a = X // 500
  b = a // 5
  print(a * 1000 + b * 5)
  

X = input()
X = int(X)
if 0 <= X and X <= 10**9:
  a = X // 500
  b = (X % 500) // 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):
X = input()
nfh = X // 500
nf = (X - 500 * nfh) // 5
happy = 1000 * nfh + 5 * nf
print(happy)

X = input()
n500 = X // 500
n5 = (X - 500 * n500) // 5
happy = 1000 * n500 + 5 * n5
print(happy)

X = input()
n500 = X // 500
n5 = (X - 500 * n500) // 5
happy = 1000 * n500 + 5 * n5
print(happy)

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

Verdicts: Runtime Error

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())import math
X = int(input())
A = X/500
A=math.floor(A)
Q=1000*A
D=A*500
Y=X-D
B = Y/5
B = math.floor(B)
B= 5*B
print(Q+B)

import math
X = int(input())
A = X/500
A=math.floor(A)
Q=1000*A
D=A*500
Y=X-D
B = Y/5
B = math.floor(B)
B= 5*B
print(int(Q+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):
x=int(input())
i=x//500
a=(x-i)//5
sum=i*1000+a*5
print sum


x=int(input())

i=x//500
a=(x-i)//5
print('i*1000+a*5')


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

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


Verdicts: Runtime Error

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())
print('{}'.format(str(int(x/500)*1000 + x%500))

N=int(input())
print('{}'.format(str(int(N/500)*1000+int(N%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):
x = int(input())
print(x // 500 * 2 + x % 500 // 5 * 5)


x = int(input())
print(x // 500 * 1000 + x % 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())
a=x // 500
y=x-500a
b= y // 5
happy = a*1000+b*5
print(happy)

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

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

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()

a=int(x%500)

b=int((x-a*500)%5)

c=1000*a+5*b

print(c)

x=input()

a=int(x%500)

b=int((x-a)%5)

c=1000*a+5*b

print(c)

x=input()

a=int(x//500)

b=int((x-a)//5)

c=1000*a+5*b

print(c)

x=int(input())

a=x//500

b=(x-a*500)//5

print(1000*a+5*b)

Verdicts: Runtime Error

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%500/5*5)

x=int(input())
print(x//500*1000+x%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):
money = input()
happy = money//500+(money-money//500)//5
print(happy)

money = int(input())
happy1 = money//500
happy2 = (money-happy1*500)//5
print(happy1*1000+happy2*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())
 
happy = 0
 
happy += int((money / 500) * 1000)
 
money -= int((money / 500) * 500)
 
happy += int((money / 5) * 5)
 
print(happy)

money = int(input())

num_500 = int(money / 500)

remaining = int(money % 500)

num_5 = int(remaining / 5)

print('{}'.format(num_500 * 1000 + num_5 * 500 ))

money = int(input())

happy = 0

happy += (money / 500) * 1000

money -= (money / 500) * 500

happy += (money / 5) * 5

print(happy)

money = int(input())

num_500 = int(money / 500)

remaining = int(money % 500)

num_5 = int(remaining / 5)

print('{}'.format(num_500 * 1000 + num_5 * 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 = int(input())
print(2 * x + x % 500)

x = int(input())
print((x//500) * 1000 + ((x % 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("How much yen: "))
output = 0
if X >= 500:
    output += 500 * (X // 500)
    X = X - (X % (X // 500))
output += 5 * (X // 5)

print(output)

X = int(input("How much yen: "))
output = 0
if X >= 500:
    output += 500 * (X // 500)
    X = X - (500 % (X // 500))
output += 5 * (X // 5)

print(output)

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())

changes=[500,100,50,10,5,1]

result=[]

tmp=X

for c in changes:
    if(tmp==0):
        result.append(0)
    else:
        result.append(int(tmp/c))
        tmp=tmp%c

total=0

for idx in range(len(result)):
    if(idx==0):
        total+=result[idx]*1000
    else:
        total+=result[idx]*changes[idx]

print(total)


X=int(input())

changes=[500,100,50,10,5,1]

tmp=X
total=0

result=[]

result.append(int(tmp/500))

tmp=tmp%500

result.append(int(tmp/5))

total+=result[0]*1000
total+=result[1]*5

print(total)

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())

ans = X // 500
X = X - 500 * ans
ans += X // 5
print(ans)

X = int(input())

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

x = int(input())

ans = x // 500 + (x - (x // 500) * 500) // 5
print(ans)

X = int(input())

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

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):
import sys, re
import math
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

# -*- coding: utf-8 -*-

x = INT()
a = math.floor(x / 500)
b = math.floor((x - (a * 500)) / 5)
print(a)
print(b)
print(a * 1000 + b * 5)

import sys, re
import math
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

# -*- coding: utf-8 -*-

x = INT()
if x == 0:
    print(0)
else:
    a = math.floor(x / 500)
    b = math.floor((x - (a * 500)) / 5)
    print(a * 1000 + b * 5)

Verdicts: Wrong Answer

Accepted