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

l=[]
for i in range(int(X/500)+1):
  for j in range(int(X/5)+1):
    l.append(1000*i+5*j)
    
s = sorted(l,reverse=True)
print(s[0])

X = int(input())

a = int(X/500)
b = (X - 500*a)/5
H = 1000 * a + 5 * b
print(int(H))

X = int(input())

a = int(X/500)
b = int((X - 500*a)/5)
H = 1000 * a + 5 * b
print(H)

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

y = X//500
z = X%500
a = z//5 

A = 1000*y+5*a
print(a)

X = input()
X = int(X)
y = X//500
z = X%500
a = z//5 

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

amari = n%500

b = amari/5
ans = int(a*1000+b*5)
print(ans)

n = int(input())
a = int(n/500)

amari = n%500

b = int(amari/5)
ans = int(a*1000+b*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):
def main():
    X = int(input())
    q1,r1 = divmod(X,500)
    q2 = int(r1/500)
    ans = 1000*q1 + 5*q2
    print(ans)

main()


def main():
    X = int(input())
    
    p = int(X/500)
    q = int((X-p*500)/5)
    ans = 1000*p + 5*q
    print(ans)

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 = x // 500
b = (x % 500)//5

s = a * 1000 + b * 5

print(s)


x = int(input())

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

s = a * 1000 + b * 5

print(s)


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):
# ABC160B

def f(x):
    joy = x // 500 * 1000
    x %= 500
    joy += x // 5 * 5
    print(joy)

x = int(input())
f(x)
f(0)
f(1000000000)


def f(x):
    joy = x // 500 * 1000
    x %= 500
    joy += x // 5 * 5
    print(joy)

x = int(input())
f(x)


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())
x-=(x//500)*500
y=x//5
print((x//500)*1000+5*y)


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

cnt=0

if n>=500:
  cnt+=n//500
  n=n%500
  
cnt+=n//5

print(cnt)

n=int(input())
cnt=0

if n>=500:
  x=n//500
  n=n%500
  cnt+=(1000*x)

cnt+=(5*n//5)

print(cnt)

n=int(input())
cnt=0

if n>=500:
  x=n//500
  n=n%500
  cnt+=(1000*x)
cnt+=(5*(n//5))

print(cnt)

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

a=0
b=0
aper=0
if x!=0:
    a=x//500
    aper=x%500

if aper != 0:
    b= b/5
    bper = b%5

result = (a * 1000) + (b*5)

print(int(result))


x = int(input())

a=0
b=0
aper=0
if x!=0:
    a=x//500
    aper=x%500

if aper != 0:

    b= aper//5
    bper = aper%5

result = (a * 1000) + (b*5)

print(int(result))





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 >= 500:
  q = X // 500 
  mod = X % 500 
  f = mod // 5
  print(q*1000+f*5)
else:
  f = X // 5
  print(f*5

X = int(input())
if X >= 500:
  q = X // 500 
  mod = X % 500 
  f = mod // 5
  print(q*1000+f*5)
else:
  f = X // 5
  print(f*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) * 1000 + ((x % 500) / 5) * 5)


x = int(input())

print((x / 500) + ((x % 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):
s=list(input())
if s[2]==s[3] and s[4]==s[5]:
  print("Yes")
else:
  print("No")

X=int(input())
happy=(X//500)*1000
left=X%500
happy+=(left//5)*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):
x=int(input())
i=0
u=0
while 500<=x:
    x-=500
    i+=1
while x>=5:
    x-=5
    u+=1
print(5*i+u)

x=int(input())
i=0
u=0
while 500>=x:
    x-=500
    i+=1
while >=5:
    x-=5
    u+=1
print(5*i+u)

x=int(input())
i=0
u=0
while 500>=x:
    x-=500
    i+=1
while x<=5:
    x-=5
    u+=1
print(5*i+u)


x=int(input())
i=0
u=0
while 500<=x:
    x-=500
    i+=1
while x>=5:
    x-=5
    u+=1
print(1000*i+5*u)

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):
a=int(input())
hp = (a-(a%500))/500
f=(a%500)
ct=int(hp)*1000
ct+=int((f-(a%5))/5)*5

a=int(input())
hp = (a-(a%500))/500
f=(a%500)
ct=int(hp)*1000
ct+=int((f-(a%5))/5)*5
print(ct)

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

q1, mod1 = divmod(x, 500)
q2, mod2 = divmod(mod1, 5)

print(mod1*1000 + mod2*5)

x = int(input())

q1, mod1 = divmod(x, 500)
q2, mod2 = divmod(mod1, 5)

print(q1*1000 + q2*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 sys
input = sys.stdin.readline

def main():
    X = int(input())
    ans = 0
    ans += X//500
    ans = ans * 1000 + X - ans * 500
    print(ans)


if __name__ == "__main__":
    main()

import sys
input = sys.stdin.readline

def main():
    X = int(input())
    X -= X%5
    tmp = X//500
    print(tmp * 500 + X)


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

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

n=int(input())
tener=int(n/500)
res=n-(tener*500)
fiver=int(res/5)
print((tener*1000)+(fiver*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, B = divmod(X, 500)
C, D = divmod(X, 5)
 
print(A * 1000 + C * 5)

X = int(input())

A, B = divmod(X, 500)
C, D = divmod(X, 5)

print((A * 1000) + (C * 5))


X = int(input())
 
A, X = divmod(X, 500)
C, X = divmod(X, 5)
 
print((A * 1000) + (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):
def solve():
  val = int(input())
  print(val/500 * 1000 + (val%500)/5 * 5)
solve()

def solve():
  val = int(input())
  print(val//500 * 1000 + (val%500)//5 * 5)
solve()

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=0
G=0
N=0
M=0
Z=0
N=int(X/500)
M=int(X%500)
Z=int(M/5)
N=N+Z
for i in range(0,N):
    if X-500:
        X=X-500
        G=G+1000
    elif X-5:
        X=X-5
        G=G+5
    else:
        break
        
print(G)

X=int(input())
A=0
G=0
N=0
M=0
Z=0
N=X/500
M=int(X%500)
Z=M/5
N=N+Z
for i in range(0,N):
    if X-500:
        X=X-500
        G=G+1000
    elif X-5:
        X=X-5
        G=G+5
    else:
        break
        
print(G)
        
    

X=int(input())
A=0
G=0
N=0
M=0
Z=0
N=X/500
M=int(X%500)
Z=M/5
N=N+Z
for i in range(0,N):
    if X-500:
        X=X-500
        G=G+1000
    elif X-5:
        X=X-5
        G=G+5
    else:
        break
        
print(G)

X=int(input())
N=int(input())
Z=int(input())
A=0
G=0
N=0
M=0
Z=0
N=X/500
M=int(X%500)
Z=M/5
N=N+Z
for i in range(0,N):
    if X-500:
        X=X-500
        G=G+1000
    elif X-5:
        X=X-5
        G=G+5
    else:
        break
        
print(G)


X=int(input())
N=int(input())
Z=int(input())
A=int(input())
G=int(input())
M=int(input())
A=0
G=0
N=0
M=0
Z=0
N=X/500
M=int(X%500)
Z=M/5
N=N+Z
for i in range(0,N):
    if X-500:
        X=X-500
        G=G+1000
    elif X-5:
        X=X-5
        G=G+5
    else:
        break
        
print(G)

X=int(input())
A=0
G=0
N=0
M=0
Z=0
N=int(X/500)
M=int(X%500)
Z=int(M/5)
N=N+Z
for i in range(0,N):
    if X>=500:
        X=X-500
        G=G+1000
    elif X>=5:
        X=X-5
        G=G+5
    else:
        break
        
print(G)


Verdicts: Wrong Answer

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

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

import math
x = int(input())
ans = 0
if math.floor(x/500) >=1 :
    ans += math.floor(x/500)*1000
    x -= math.floor(x/500)*500
if x > 0 and math.floor(x/5) >=1 :
    ans +=  math.floor(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())
fhun = X//500
amari = X % 500
fiv = amari//5
ure = fhun + fiv

X = int(input())
fhun = X//500
amari = X % 500
fiv = amari//5
ure = fhun + fiv

print(ure)

X = int(input())
fhun = X//500
amari = X % 500
fiv = amari//5
ure = fhun*1000 + fiv*5

print(ure)

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):
money = int(input())
big = money // 500
amari = money % 500
small = amari // 5
print(big + small)

money = int(input())
big = money // 500 * 1000
small = (money % 500) // 5 * 5
print(big + small)

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

X = int(input())
happy = (X // 500) * 1000 + ((X % 500) // 5) * 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):
def INT(): x = int(input()) return x
def LIST(): x = list(map(int, input().split())) return x

X =INT()

p = X//500
q= (X%500)//5

print(p*1000+q*5)


X = int(input())

p = X//500
q= (X%500)//5

print(p*1000+q*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):
l = int(input())
if l>=1000:
    print(l*2)
elif l>=0 and l<1000:
    print(l)

coin = int(input("Enter your coin to exchange: "))
if coin>= 100:
	print(2*coin)
elif coin<=50:
  print(coin)
else:
  print("Invalid")
	

l = input()
if l>1000:
  print(l*2)
elif l>=0 and l<1000:
  print(l)
else:
  print("Invalid")

coin = int(input("Enter your coin to exchange: "))
happy_coin = 2*coin
print(happy_coin)

l = int(input())
if l>=1000:
    print(l*2)
elif l>=0 and l<1000:
    print(l)
else:
    print("Invalid")

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

Verdicts: Wrong Answer

Wrong Answer

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

happy1 = ( coin // 500 ) * 1000
happy2 = (coin // 500 ) // 5 * 5

print( happy1 + happy2 )

coin = int(input())
 
happy1 = ( coin // 500 ) * 1000
happy2 = (coin % 500 ) // 5 * 5
 
print( happy1 + happy2 )

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())
gold = x % 500
silver = (x - 500*g) % 5
fun = gold*1000 + silver*5
print(fun)

x = int(input())
gold = x % 500
silver = (x - 500*gold) % 5
fun = gold*1000 + silver*5
print(fun)


x = int(input())
gold = x % 500
silver = (x - 500*gold) % 5
print(gold*1000 + silver*5)


x = int(input())
gold = int(x/500)
silver = int((x - 500*gold)/5)
print(gold*1000 + silver*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):
yen=int(input())
big=yen//500
small=(yen-500*big)//5
print(1000*big+5*small

yen=int(input())
big=yen//500
small=(yen-500*big)//5
print(1000*big+5*small)

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

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

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

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

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

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

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
while (not X == 0) and (X%500==0) or (X%5==0):
  if X%500==0:
    cnt+=1000
    X - 500
  elif X%5 == 0:
    cnt+=5
    X-5
  else:
    break
    
print(cnt)

X = int(input())


X1 = X // 500
X2 = X % 500
X3 = X2 // 5

cnt = X1 * 1000 + X3*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
b = (x%500)//5
print(a,b)
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):
x = int(input())

ans = 0

l500 = x // 500

x -= l500 * 500

l5 = x // 5

print(l500 * 1000 + l5)


x = int(input())

ans = 0

while x >= 500:
  x -= 500
  ans += 1000

while ans >= 5:
  x -= 5
  ans += 5

print(ans)

x = int(input())

ans = 0

l500 = x // 500

x -= l500 * 500

l5 = x // 5

print(l500 + l5)

x = int(input())

ans = 0

l500 = x // 500

#print(l500)#
x -= l500 * 500
#print(x)#
l5 = x // 5
#print(l5)#
print(l500 * 1000 + l5 * 5)
#print('                  ')#


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):
money = int(input())
fh = n // 500
money -= 500 * fh
goen = money // 5

point = 1000 * fh + 5 * goen
print(point)

money = int(input())
fh = money // 500
money -= 500 * fh
goen = money // 5

point = 1000 * fh + 5 * goen
print(point)


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

x = int(input())
c_fh = x // 500
p_fh = c_fh * 1000
c_f = (x % 500) // 5
p_f = c_f *5
print(p_fh + p_f)

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

S500 = S/500

S_nokori = S-S500*500

S5 = S_nokori/5

print(1000*S500 + 5*S5)

S = int(input())
SS = S//500
SSS = (S%500)//5
print(1000*SS + 5*SSS)

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


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

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

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())
counta = 0
countb = 0
while X%500 == 0:
  counta +=1
  X//=500
  
while X%5==0:
  countb +=1
  X//=5
print(1000*counta+5*countb)

X = int(input())
counta = 0
countb = 0
while X>=500:
  counta +=1
  X -= 500
  
while X>=5:
  countb +=1
  X -= 5
print(1000*counta+5*countb)


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

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

x = int(input())
if x >= 500:
  a = int(x/500)
  b = x%500
  print(a*1000+b*5)
else:
  print(int(x/5)*5)

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

cnt = 0
while X >= 500:
	X -= 500
	cnt += 1000

while X >= 5:
	X -= 5
	cnt += 10

print(cnt)

X = int(input())

cnt = 0
while X >= 500:
	X -= 500
	cnt += 1000

while X >= 5:
	X -= 5
	cnt += 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
b = x % 500
b /= 5
print(int(a * 1000 + b * 5))

x = int(input())
a = int(x // 500)
b = int((x % 500) / 5)

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

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

main()




def main():
    x = int(input())
    
    a = x // 500
    x %= 500

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

main()




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

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

a=x//500
b=x%500

s=(1000*a)+(b)
print(s)



x=int(input())

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

s=(1000*a)+(b)
print(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):
import bisect,collections,copy,itertools,math,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
X = I()
_500 = X//500
_nokori = (X%500)//5
print(_nokori)
print(_500*1000+_nokori*5)


import bisect,collections,copy,itertools,math,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
X = I()
_500 = X//500
_nokori = (X%500)//5
print(_500*1000+_nokori*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()

U500 = int(S) // 500
U5 = (int(S) % 500)//5
happy = U500*1000+U5
print(str(happy))

S = input()

U500 = int(S) // 500
U5 = (int(S) % 500)//5
happy = U500*1000+U5*5
print(str(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):
N = int(input())
A = N//500
B = (N-A)//5
print(A*1000+B*5)

N = int(input())
A = N//500
B = (N-A*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):
X=int(input())

w=int(X/500)*1000
X=int(X/500)
x=int(X/5)*5
print(w+x)


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

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):
num = int(input().strip())
ans = 0
ans += (num//500)*1000
num = num%500
ans += (num//5)
print(ans)


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

X = input()

a = X / 500
b = X % 500
c = b / 5
    
print(a * 1000 + c * 5)

X = int(input())

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


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):
#2020-03-28
#ABC
S = int(input())
count = int(S / 500)
sum = 1000 * count
print(sum)
S = S - 500*count
sum = sum + 5*(int(S/5))
print(sum)

#2020-03-28
#ABC
S = int(input())
count = int(S / 500)
sum = 1000 * count
S = S - 500*count
sum = sum + 5*(int(S/5))
print(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):
coin_value = [[500, 1000], [5, 5]]
result = 0
x = int(input().strip())
idx = 0
for coin, value in coin_values:
    result += value * (x // coin)
    x = x - x // coin * coin
  
print(result)
  
  

coin_value = [[500, 1000], [5, 5]]
result = 0
x = int(input().strip())
idx = 0
for coin, value in coin_values:
  result += value * (x // coin)
  x = x - x // coin * coin
  
print(result)

coin_values = [[500, 1000], [5, 5]]
result = 0
x = int(input().strip())
idx = 0
for coin, value in coin_values:
    result += value * (x // coin)
    x = x - x // coin * coin
  
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 = input()
temp = (x // 500) * 1000
x %= 500
ans = temp + (x // 5) * 5
print(ans)

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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


    return

if __name__ == '__main__':
    main()

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

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

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

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

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

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

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())
t = x//500
f = (x-t)//5
print((t*1000) + (f*5))

x = int(input())
t = x//500
f = (x-t*500)//5
print((t*1000) + (f*5))


Verdicts: Wrong Answer

Accepted