Problem:


Score : 200 points

Problem Statement

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

Constraints

0 \leq X \leq 10^9

X is an integer.

Input

Input is given from Standard Input in the following format:

X

Output

Print the maximum number of happiness points that can be earned.

Sample Input 1

1024

Sample Output 1

2020

By exchanging his money so that he gets two 500-yen coins and four 5-yen coins, he gains 2020 happiness points, which is the maximum number of happiness points that can be earned.

Sample Input 2

0

Sample Output 2

0

He is penniless - or yenless.

Sample Input 3

1000000000

Sample Output 3

2000000000

He is a billionaire - in yen.



Sample input:
1024


Sample output:
2020

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

a, mod = divmod(X, 500)
b = mod % 5

print(a * 1000 + b * 5)

Submission status: Wrong Answer

Solution code:
X = int(input())
happy = (X // 500) * 1000 + ((X % 500) // 5) * 5
happy

Submission status: Wrong Answer

Solution code:

x = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())

ans = x//500

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

print(ans**1000+ans_2*5)

Submission status: Wrong Answer

Solution code:
'''
問題：
    高橋君は金色の硬貨が好きです。
    自分が持っている 500円硬貨 1枚につき 1000、
    5円硬貨 1枚につき 5の嬉しさ を得ます。

    高橋君は X 円を持っています。
    これを高橋君の嬉しさが最大になるように両替したとき、高橋君の嬉しさはいくらになりますか？

    (なお、利用できる硬貨は 500 円玉、100 円玉、50 円玉、10 円玉、5円玉、1 円玉の 6 種類とします。)
'''

'''
    Xは整数
    0 ≦ X ≦ 1,000,000,000
'''
class A:
    def __init__(self, money, yorokobi):
        self.money = money
        self.yorokobi = yorokobi

    def calc_yorokobi(self, credit):    # credit ：残金を入力として受け取り、喜びを計算して返す
        return int(credit / self.money) * self.yorokobi

    # def print_self(self):
        # print(calc_yorokobi(self, credit))

def calc_yorokobi(input_money, x, yorokobi):
    ret = input_money // x * yorokobi
    return ret

# 標準入力から X の値を取得する
input_x = int(input())

yorokobi_500 = A(500, 1000)
yorokobi_5 = A(5, 5)

result = 0  # 結果格納用
if input_x >= 500:
    print("1回目：{}".format(result))
    result += yorokobi_500.calc_yorokobi(input_x)   # 高橋500円の喜び
    print("2回目：{}".format(result))
    result += yorokobi_5.calc_yorokobi(input_x % 500)   # 高橋5円の喜び
    print("3回目：{}".format(result))
else:
    result += yorokobi_5.calc_yorokobi(input_x)

print(result)

Submission status: Wrong Answer

Solution code:
input_X = int(input())

result_500 = input_X // 500
result_500ureshi = result_500 * 1000
result_5ureshi = (input_X - result_500 * 500) // 5 * 5

print(result_500ureshi)
print(result_5ureshi)
result = int(result_500ureshi + result_5ureshi)
print(result)

Submission status: Wrong Answer

Solution code:
x=int(input())
happiness=0
if(x>500):
	sum_amount=x//500
	happiness+=sum_amount*1000
	diff=x-happiness/2	
	z=int(diff/5)
	happiness+=z*5
	print(happiness)	

elif(x<500):
	k=int(x/5)
	ans=k*5
	print(ans)
elif(x==0):
	print(0)
elif(x==1):
	print(1)

Submission status: Wrong Answer

Solution code:
x=int(input())
happiness=0
if(x>500):
	sum_amount=x//500
	happiness+=sum_amount*1000
	diff=x-happiness/2	
	z=int(diff/5)
	happiness+=z*5
	print(happiness)	

elif(x<500):
	k=int(x/5)
	ans=k*5
	print(ans)
elif(x==0):
	print(0)

Submission status: Wrong Answer

Solution code:
x=int(input())
happiness=0
if(x>500):
	sum_amount=x//500
	happiness+=sum_amount*1000
	diff=x-happiness/2	
	z=int(diff/5)
	happiness+=z*5
	print(happiness)	

elif(x<500):
	k=int(x/5)
	ans=k*5
	print(ans)
elif(x==0):
	print(x)

Submission status: Wrong Answer

Solution code:
x=int(input())
happiness=0
if(x>500):
	sum_amount=x//500
	happiness+=sum_amount*1000
	diff=x-happiness/2	
	z=int(diff/5)
	happiness+=z*5
	print(happiness)	

elif(x<500):
	k=int(x/5)
	ans=k*5
	print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    X = int(input())
    cnt500 = 0
    cnt5 = 0

    while X > 0:
        if X >= 500:
            X -= 500
            cnt500 += 1

        if 500 > X >= 0:
            X -= 5
            cnt5 += 1

    print(cnt5*5 + cnt500*1000)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    X = int(input())
    cnt500 = 0
    cnt5 = 0

    while X > 0:
        if X >= 500:
            X -= 500
            cnt500 += 1

        if 500 > X > 0 :
            X -= 5
            cnt5 += 1

    print(cnt5*5 + cnt500*1000)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
(x//500)*1000+(x%500//5)*5

Submission status: Wrong Answer

Solution code:
N=int(input());print((((1000)*(N//500))+(N-((1000)*(N//500)))//5)*5)

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:
X = int(input())

H = 0
if X > 500:
    H = (X // 500) * 1000
H += ((X % 500) // 5) * 5

print(H)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=a//500
c=(a-b)//5
print(1000*b+5*c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
glad = 0

while True:
    if x < 5:
        break
    if x > 500:
        glad += x // 500 * 1000
        x = x % 500
    else:
        glad += x // 5 * 5
        x = x % 5
print(glad)

Submission status: Wrong Answer

Solution code:
x=int(input())
n=x//500
m=x%500//5
ans=500*n+5*m
print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())

a = X//500
b = (X-a*500)%5

print(a*1000+b*5)

Submission status: Wrong Answer

Solution code:
x = int(input())
yen_500 = 0
yen_5 = 0
amari = 0
happy = 0

if x> 500:
    yen_500 = x//500
    amari = x - 500 * yen_500
    yen_5 = amari//5
    happy = 1000 * yen_500 + 5 * yen_5
    print(happy)
else:
    yen_5 = x//5
    happy = 5 * yen_5
    print(happy)

Submission status: Wrong Answer

Solution code:
x = int(input())
print((x//500)*5 + ((x%500)//5)*5)

Submission status: Wrong Answer

Solution code:
x=int(input())
i=0
j=0
if 500<= x:
  while i*500<x:
    i+=1
  i-=1
  x-=500*i
if 5<=x:
  while j*5<x:
    j+=1
  j-=1
if i==0 and j==0:
  print(0)
else:
  print(1000*i+5*j)

Submission status: Wrong Answer

Solution code:
x=int(input())
i=0
j=0
while i*500<x:
  i+=1

x-=(i-1)*500
while j*5<x:
  j+=1
print((i-1)*1000+(j-1)*5)

Submission status: Wrong Answer

Solution code:
X = int(input())
a = X%500
print(a*1000+a%5*5)

Submission status: Wrong Answer

Solution code:
X = int(input())
print((X%500)%5)

Submission status: Wrong Answer

Solution code:
X = int(input())

ans=0
X2 = X

if X < 500:
    print((X // 5) * 5)
else:
    ans += (X // 500)*1000
    X2 -= (X//500)*500
    ans += (X2//5)*5

print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())

ans=0

if X < 500:
    print((X // 5) * 5)
else:
    ans += (X // 500)*1000
    X -= (X//500)*500
    ans += (X//5)*5

print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 0
ans += (x // 500) * 1000
ans += ((x % 1000) // 5) * 5
print(ans)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
X = int(input())

num1000 = X // 500
r500 = X % 1000
num5 = r500 // 5

print(num1000 * 1000 + num5 * 5)

Submission status: Wrong Answer

Solution code:
X = int(input())

num1000 = X // 500;
r500 = X % 1000
num5 = r500 // 5;

print(num1000 * 1000 + num5 * 5)

Submission status: Wrong Answer

Solution code:
X = int(input())

num1000 = X // 500;
num5 = X % 1000 // 5;

print(num1000 * 1000 + num5 * 5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())
ans=a//500+(a-(a//500)*500)//5
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = x//500
b = (x%500)//50

print(a*1000 + b*5)

Submission status: Wrong Answer

Solution code:
x=int(input())
x-=(x//500)*500
y=x//5
print((x//500)*1000+5*y)

Submission status: Wrong Answer

Solution code:
X = int(input())
x1 = X%500
x2 = x1%5
print(x1*1000+x2*5)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = N // 500
N -= 500 * a
b = N // 5
print(a * 500 + b * 5)

Submission status: Wrong Answer

Solution code:
a = int(input())
print(2*(a//500) + (a - a//500)//5)

Submission status: Wrong Answer

Solution code:
X = int(input())
a = X%500
print(a*1000 + 5*((X-a*500)%5))

Submission status: Wrong Answer

Solution code:
X=int(input())
a=X//500
if a==0:
    print(a*1000)
else:
    b=(X-500*a)//5
    print(a*1000+b*5)

Submission status: Wrong Answer

Solution code:
X=int(input())
a=X//500
if X//500==0:
    print(a*1000)
else:
    b=(X-500*a)//5
    print(a*1000+b*5)

Submission status: Wrong Answer

Solution code:
X = int(input())
m500 = X // 500
X -= m500 * 500
m5 = X // 5
print(1000 * m500 + 100 * m5)

Submission status: Wrong Answer

Solution code:
N=int(input())
n1=N//500-N//5000
n2=N-n1*500
n3=n2//5-n2//50
print(n1*1000+n3*5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())
if a==0:
    print(0)
b = a//500
c = a%500
if c!=0:
    d = c//5
    print((b*1000)+d*5)
elif c==0:
    print(b*1000)

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=0

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

cnt+=(5*n//5)

print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())

cnt=0

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

print(cnt)

Submission status: Wrong Answer

Solution code:
x=input()

a500=int(x)//500*1000

a5=x[-3:]
a5=int(a5)//5*5
print(a500+a5)

Submission status: Wrong Answer

Solution code:
x = int(input())

c500, r500 = map(int, divmod(x, 500))
c5 = int(r500 % 5)

ans1 = c500 * 1000 + c5 * 5

print(c500 * 1000 + c5 * 5)

Submission status: Wrong Answer

Solution code:
x = int(input())

c500, r500 = map(int, divmod(x, 500))
c5 = int(x % 5)

ans1 = c500 * 1000 + c5 * 5

print(c500 * 1000 + c5 * 5)

Submission status: Wrong Answer

Solution code:
x = int(input())

xx = x
c500, xx = divmod(xx, 500)
c5 = xx % 5

ans1 = c500 * 1000 + c5 * 5

xx = x
c5 = xx % 5

ans2 = c5 * 5

print(max(ans1, ans2))

Submission status: Wrong Answer

Solution code:
x = int(input())

c500, x = divmod(x, 500)
c5 = x % 5

print(c500 * 1000 + c5 * 5)

Submission status: Wrong Answer

Solution code:
X = int(input())
tmp = 0

if X >= 500:
    tmp = X // 500 * 1000

if 5 <= X < 500:
    tmp += X // 5 * 5

print(tmp)

Submission status: Wrong Answer

Solution code:
x = int(input())
coins = {500: 0, 100: 0, 50: 0, 5: 0}
for coin in coins.keys():
  coins[coin] = x // coin
  if coins[coin] > 0:
    x -= coin * coins[coin]
print(1000 * coins[500] + 5 * coins[5])

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
X=int(input())
A=0
B=0
C=0
D=0
while A<=X:
  A+=500
  B+=1000
while C<=X%500:
  C+=5
print(B+C)

Submission status: Wrong Answer

Solution code:
X=int(input())
A=0
B=0
C=0
D=0
while A<=X:
  A+=500
  B+=1000
while C<=X%500:
  C+=5
  D+=5
print(B+D)

Submission status: Wrong Answer

Solution code:
X=int(input())
A=0
B=0
C=0
D=0
while A<=X:
  A+=500
  B+=1000
while C<=X//500:
  C+=5
  D+=5
print(B+D)

Submission status: Wrong Answer

Solution code:
x = int(input())
y = x % 500
print(x // 500 + y // 5)

Submission status: Wrong Answer

Solution code:
x = int(input())
print((x%500)*1000+((x%500)%5)*5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = int(X/500)*1000
X -= int(X/500)

ans = int(X/5)*5

print(ans)

Submission status: Wrong Answer

Solution code:
yen = int(input())
'''
happy= 0
while yen > 499:
  yen -= 500
  happy += 1000

while yen > 4:
  yen -=5
  happy += 5
'''
happy = 1000 * int(yen//500) + 5 * (yen - (500 * int(yen//500)))//5

print(happy)

Submission status: Wrong Answer

Solution code:
n=int(input())
print(1000*(n//500) + 5*((n//500)//5))

Submission status: Wrong Answer

Solution code:
#500円通貨1枚につき1000
#5円通貨1枚につき5
#高橋君はx円持ってる
#利用できる通貨は500円,100円,10円,5円,1円
#入力 1024

x=input()
x1=int(x) 

#まず入力を500で何回われるかを数えその回数で割り,残った値を変数に格納
r=x1/500
x2=x1%500

#同じ操作を5でおこなう
r1=x2/5
x3=x2%5

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

print(sam)

Submission status: Wrong Answer

Solution code:
#500円通貨1枚につき1000
#5円通貨1枚につき5
#高橋君はx円持ってる
#利用できる通貨は500円,100円,10円,5円,1円
#入力 1024

x=input()
x1=int(x) 

#まず入力を500で何回われるかを数えその回数で割り,残った値を変数に格納
r=x1/500
x2=x1%500

#同じ操作を5でおこなう
r1=x2/5
x3=x2%5

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

print("sam")

Submission status: Wrong Answer

Solution code:
num = int(input())

hap1000 = num/500
hap5    = (num-hap1000*500)/5

print(int(1000*hap1000+5*hap5))

Submission status: Wrong Answer

Solution code:
X=int(input())
a=int(X//500)
X=X%500
b=int(X//5)
print(a+b)

Submission status: Wrong Answer

Solution code:
# B - Golden Coins
X = int(input())
ans = 1000*(X%500)
X //= 500
ans += 5*(X%5)
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

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

print(a + c)

Submission status: Wrong Answer

Solution code:
X = int(input())
a, b = 0, 0

a = X // 500
b = (X - 500 * a) % 5

print(1000 * a + 5 * b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = input()
Y = int(X) / 500
Z = (int(X) - Y * 500) / 5
print(Y * 1000 + Z * 5)

Submission status: Wrong Answer

Solution code:
X = int(input())

#500
X_500 = X // 500 * 2
#5
X_5 = (X % 500) // 5 * 5

print(X_500 + X_5)

Submission status: Wrong Answer

Solution code:
X = int(input())

#500
X_500 = X // 500 * 2
#5
X_5 = (X % 500) // 5

print(X_500 + X_5)

Submission status: Wrong Answer

Solution code:
n = int(input())

total = 0

total += (n//500)

n %= 500#合計枚数を減らす

total += (n//5)*5#5円玉に交換する

print(total)

Submission status: Wrong Answer

Solution code:
def resolve():
    s = int(input())
    zandaka = s % 500
    zandaka2 = zandaka % 5
    ureshii_500 = (s - zandaka)/500*1000
    ureshii2 = (zandaka - zandaka2)
    goukei = ureshii2 + ureshii_500
    print(goukei)

resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    s = int(input())
    zandaka = s % 500
    zandaka2 = zandaka % 5
    ureshii_500 = (s - zandaka)/500*1000
    ureshii2 = (zandaka - zandaka2)/5*5
    goukei = ureshii2 + ureshii_500
    print(goukei)

resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    s = int(input())
    zandaka = s % 500
    zandaka2 = zandaka % 5
    ureshii_500 = (s - zandaka)/500*1000
    ureshii2 = (zandaka - zandaka2)/5
    goukei = ureshii2 + ureshii_500
    print(goukei)

resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    s = int(input())
    zandaka = s % 500
    ureshii_500 = (s - zandaka)/500*1000
    goukei = ureshii_500+zandaka
    print(goukei)

resolve()

Submission status: Wrong Answer

Solution code:
n=int(input())
print(1000*(n//500)+5*((n-(n//500)*500)%5))

Submission status: Wrong Answer

Solution code:
n=int(input())
print(1000*(n//500)+5*((n-(n%500)*500)%5))

Submission status: Wrong Answer

Solution code:
x = int(input())
print(2 * x + x % 500)

Submission status: Wrong Answer

Solution code:
x = int(input())

q_1 = x//500
r_1 = x%500

r_2 = r_1//5

print(r_1*1000+r_2*5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
ha = 0

if x >= 500:
  x %= 500
  ha  += (x // 500)*1000
  
if x >= 5:
  ha += (x // 5)*5
 
print(ha)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())
a = x//500
b = (x%500)//5
print(a,b)
print(a*1000+b*5)

Submission status: Wrong Answer

Solution code:
x=int(input())
y=x//500
if x>=500:
  num=(y*1000)+((x%500)//5*5)
  print(num)
else:
  num=x//5
  print(num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
a=500
b=5
if x>=500:
  num=(x//500*1000)+(x-x//500*500)//500
  print(num)
else:
  num=x//5
  print(num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

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

print(a*1000 + b)

Submission status: Wrong Answer

Solution code:
x = int(input())
print(x//500*500*2+x%500)

Submission status: Wrong Answer

Solution code:
S = int(input())

a=int(S/500)
#print(a)
b=int((S%500)%5)
#print(b)
print(a*1000+b*5)

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 0

ans = (X // 500) * 1000
X = X % 500

ans += X // 5

print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 0

ans = (X // 500) * 1000
X = X % 500

ans = X // 5

print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 0

ans = X // 500
X = X % 500

ans = X // 5

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

Y = X%500

Z = Y%5

print((X//500)*1000+5*Z)

Submission status: Wrong Answer

Solution code:
x=int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
a = 0
b = 0
ans = 0

if(X >= 500):
    a = X//500
    if(X-500*a >= 5):
        b = (X-500*a)//5

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

Submission status: Wrong Answer

Solution code:
x=int(input())
h=(x//500)*1000
x%=500
h+=x//5
print(h)

Submission status: Wrong Answer

Solution code:
X = int(input())
 
A, B = divmod(X, 500)
C, D = divmod(X, 5)
 
print(A * 1000 + C * 5)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
    X = int(input())
    q1,r1 = divmod(X,500)
    q2 = int(r1/500)
    ans = 1000*q1 + 5*q2
    print(ans)

main()

Submission status: Wrong Answer

Solution code:
a = int(input())
b = a/5
print(b/100 * 1000 + b%200 *5)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = (a/5)/200
c= (a/5)%200
print(b * 2000 + c*5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#B
x = int(input())
y500 = x // 500
y5 = y500 // 5
print(y500 * 1000 + y5 * 5)

Submission status: Wrong Answer

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

X = int(input())

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

Submission status: Wrong Answer

Solution code:
# 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)

Submission status: Wrong Answer

Solution code:
x = int(input())
keta = len(str(x))
ans = 0
if keta >= 4:
    ans += int(x / 1000) * 2000

ans += int(x % 1000) - int(x % 10)

print(ans)

Submission status: Wrong Answer

Solution code:
import math
X=int(input())
M=X%500
print(1000*(math.ceil(X/500)-1)+5*(math.ceil(M/5)-1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
a = X // 500

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
print(x/500 + (x%500)/5)

Submission status: Wrong Answer

Solution code:
s = int(input())

result = (s/500) * 1000 + ((s%500)/5) * 5

print(int(result))

Submission status: Wrong Answer

Solution code:
a=input()
a=int(a)
result=0
while a>500:
  a=a-500
  result=result+1000

while a>5:
  a=a-5
  result=result+5
  
print(result)

Submission status: Wrong Answer

Solution code:
import math;
x = int(input())

q, mod = divmod(x, 500)
mmod = math.floor(mod/5)
print(q, mod, mmod)

ans = 1000*q + 5*mmod
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
X=int(input())
A=X//500
B=(X%500)//5
print(A*100+B*5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
s = 1000*(x//500) + (x%500)
print(s)

Submission status: Wrong Answer

Solution code:
x = int(input())
s = 1000*(x//500)+(x%5)//5
print(s)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = 500
b = 5
q = x // a
mod = x % a
if q > 0:
  c = q * 1000
elif mod // b > 0:
  d = (mod // b) * 5
  print('c + d')
  exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
a = 500
b = 5
q = x // a
mod = x % a
if q > 0:
  c = q * 1000
elif mod // b > 0:
  d = (mod // b) * 5
  print('c + d')
else:
  print('0')

Submission status: Wrong Answer

Solution code:
x = int(input())
happy = 0

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

Submission status: Wrong Answer

Solution code:
x = int(input())
print(1000*(x//500) + 5*((x%5)%100))

Submission status: Wrong Answer

Solution code:
X=int(input())
print(int(X/500)*1000+int((X%100)/5)*5)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

INF = float('inf')

def solve():
    x = II()

    t = x // 500
    x = x - 500 * t

    t2 = x % 5
    # print(t, t2)
    print(1000*t + 5 * t2)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
# B - Golden Coins
# https://atcoder.jp/contests/abc160/tasks/abc160_b

# 所持金
X = int(input())

# 嬉しさ(= 残金計算時にも使用)
happy = 0

# 500円玉,5円玉の最大両替枚数
max_five_hundred = int(X/500)
max_five = (X-(max_five_hundred*500))/5

# 各硬化の枚数をもとに嬉しさを算出
print(int((max_five_hundred*1000)+(max_five*5)))

Submission status: Wrong Answer

Solution code:
x=int(input())
a = x // 500
x %= 500
b = x // 5
print(a+b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
print(X / 500 + (X % 500) / 5)

Submission status: Wrong Answer

Solution code:
x = int(input())

num_500 = int(x / 500)

amari = x - num_500

num_5 = int(amari / 5)

print(1000 * num_500 + 5 * num_5)

Submission status: Wrong Answer

Solution code:
x = int(input())

num_500 = x / 500

amari = x - num_500

num_5 = int(amari / 5)

print(1000 * num_500 + 5 * num_5)

Submission status: Wrong Answer

Solution code:
x = int(input())

num_500 = x / 500

amari = x - num_500

num_5 = amari / 5

print(1000 * num_500 + 5 * num_5)

Submission status: Wrong Answer

Solution code:
x=int(input())

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

print(a*1000+b*5)

Submission status: Wrong Answer

Solution code:
x=int(input())

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

print(a*1000+b*5)

Submission status: Wrong Answer

Solution code:
x=int(input())
u=0##初期

## x=500*a+50*b+c d=50*b+c
a=x//500
d=x%500
b=d%5

print(a*1000+b*5)

Submission status: Wrong Answer

Solution code:
x = int(input())

h = (x//1000)*2000 + ((x%1000)//5)*5
print(h)

Submission status: Wrong Answer

Solution code:
X = int(input())

print((X//5)*5)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
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])

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 0
ans += 1000*x//500 + 5*(x%500)//5
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
print(x//500*100 + x%500//5*5)

Submission status: Wrong Answer

Solution code:
s = int(input())
print((s//500)*1000 +  ((s%500)%5)*5 )

Submission status: Wrong Answer

Solution code:
n = int(input())

q, r = divmod(n, 500)
answer = 1000 * q + 5 * (r % 5)
print (answer)

Submission status: Wrong Answer

Solution code:
import sys

n = int(input())

buf = 0            #嬉しさポイント
m = 0               #残金

if n == 0:
    print("0")
    sys.exit()

def check(x,buf):
    if x >= 500:
        m = x%500
        buf += (x//500)*1000
        buf = check(m,buf)
        return buf
    elif x >= 5:
        m = x%5
        buf += (x//5)*5
        return buf

kei = check(n,buf)
print(kei)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = x // 500
print((x // 500) * 1000 + x - 500 * a)

Submission status: Wrong Answer

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

X = inputI()

a = X//500

r = X%500

b = r//50

print(a*1000+b*5)

Submission status: Wrong Answer

Solution code:
#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)

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 0
if x // 500 > 0:
    ans += 1000*(x//500)
    x %= 500
    if x // 5 > 0:
        ans += 5*(x//5)
        print(ans)
    else:
        print(ans)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = n // 500
b = (n-n%500) // 5
print(1000 * a + 5 * b)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
#coin : happy
#500 : 1000
#5 : 5
X = int(input())
x500 = X // 500 * 1000
x5 = (X - x500) // 5 * 5
print((x500 + x5)*2)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=a%500
print(a//500+b//5)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = N//500
B = (N-A)//5
print(A*1000+B*5)

Submission status: Wrong Answer

Solution code:
a = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())
waru_500 = x // 500
amari = x % 500
waru_5 = amari // 5

print(waru_500 + waru_5)

Submission status: Wrong Answer

Solution code:
yen = 1024
if yen == 1024:
  print(2020)