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: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

sen_ure = x // 500
go_ure = (x - sen_ure * 500) // 5

print(sen_ure * 1000 + go_ure * 5)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
import math
# stdin = open("sample.txt")

X = int(stdin.readline().rstrip())
ans = (X//500)*1000
x = X%500
ans += ((x//5)*5)
print(ans)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())
happiness = 0
happiness, mod =  divmod(x, 500)
happiness *= 1000
happiness += (mod//5)*5
print(happiness)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

a = int(x//500)
r = x%500

b =int(r/5)

res = a*1000 + b*5

print(res)

Submission status: Accepted

Solution code:
x = int(input())
fh = x // 500
x = x % 500

f = x // 5
print(fh * 1000 + f * 5)

Submission status: Accepted

Solution code:

X = int(input())

p = 0

q, X = divmod(X, 500)
p += q * 1000

q, X = divmod(X, 5)
p += q * 5

print(p)

Submission status: Accepted

Solution code:
mod = 10**9 + 7

def iip(listed = False):
    ret = [int(i) for i in input().split()]
    if len(ret) == 1 and not listed:
        return ret[0]
    return ret

def soinsuu_bunkai(n):
    ret = []
    for i in range(2, int(n**0.5)+1):
        while n % i == 0:
            n //= i
            ret.append(i)
        if i > n:
            break
    if n != 1:
        ret.append(n)
    return ret


def conbination(n, r, mod, test=False):
    if n <=0:
        return 0
    if r == 0:
        return 1
    if r < 0:
        return 0
    if r == 1:
        return n
    ret = 1
    for i in range(n-r+1, n+1):
        ret *= i
        ret = ret % mod

    bunbo = 1
    for i in range(1, r+1):
        bunbo *= i
        bunbo = bunbo % mod

    ret = (ret * inv(bunbo, mod)) % mod
    if test:
        #print(f"{n}C{r} = {ret}")
        pass
    return ret


def inv(n, mod):
    return power(n, mod-2)

def power(n, p):
    if p == 0:
        return 1
    if p % 2 == 0:
        return (power(n, p//2) ** 2) % mod
    if p % 2 == 1:
        return (n * power(n, p-1)) % mod

#####################################################ライブラリ集ここまで

def main():
    n = iip()
    ret = 0
    ret += (n // 500) * 1000
    n = n % 500
    ret += (n // 5) * 5
    print(ret)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


a=int(input())


fiveHun=math.floor(a/500)
five=math.floor((a-500*fiveHun)/5)

print(fiveHun*1000+five*5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

q1,mod1 = divmod(X,500)

q2,mod2 = divmod(X-500*q1,5)

print(1000*q1+5*q2)

Submission status: Accepted

Solution code:
x = int(input())
gohyaku = x//500
amari = x - gohyaku * 500
go = amari // 5

print(gohyaku * 1000 + go * 5)

Submission status: Accepted

Solution code:
n=int(input())
i=0
t=0
while(n>499):
    i+=1
    n+=-500
while(n>4):
    t+=1
    n+=-5
r=1000*i+5*t
print(r)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
money = int(input())

max500 = money//500
max5 = (money%500) // 5

print(1000*max500+5*max5)

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    x = int(lines[0])

    return (x, )


def solve(x, ):


    y = x // 500
    z = x % 500
    w = z // 5

    result = 1000 * y + 5 * w


    
    return result
    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Accepted

Solution code:
import math

yen = int(input())
coin500 = math.floor(yen / 500)
yen -= (coin500 * 500)
coin5 = math.floor(yen / 5)

happiness = (coin500 * 1000) + (coin5 * 5)
print(happiness)

Submission status: Accepted

Solution code:
def main(x):
    res = 0
    val, mod = divmod(x, 500)
    res += val * 1000
    val, mod = divmod(mod,  5)
    res += val * 5
    return int(res)

x = int(input())
print(main(x))

Submission status: Accepted

Solution code:
def main():
  X = int(input())

  q, mod =divmod(X, 500)

  r, mod =divmod(mod, 5)

  ans = 1000*q + 5*r

  print(ans)

if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
m = int(input())

m_500 = m//500
m_5 = (m%500)//5

print(m_500*1000+m_5*5)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
##B
X = int(input())
X500 = X//500
X5 = (X % 500)//5

print(X500*1000+X5*5)

Submission status: Accepted

Solution code:
x = int(input())

point_500 = 1000
point_5 = 5

num_500 = x // 500
x = x % 500
num_5 = x // 5

ans = num_500 * point_500 + num_5 * point_5
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    '''
    code here
    '''
    X = int(input())
    res = (X//500)*1000
    X -= (X//500)*500
    res += (X//5)*5

    print(res)

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

amari = n%500

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def solve():
    import math
    X = int(input())
    res = 0
    res += math.floor(X/500)*1000
    res += math.floor((X%500)/5)*5
    print(res)

solve()

Submission status: Accepted

Solution code:
import collections
import math
import numpy as np
#H, W, K = map(int, input().split(' '))
# S = input()
# if S[2] == S[3]:
#     if S[4] == S[5]:
#         print('Yes')
#         exit()
# else:
#     print('No')

S = int(input())
gohyaku, amari = divmod(S, 500)
go, amari = divmod(amari, 5)

print(1000*gohyaku+go*5)

Submission status: Accepted

Solution code:
X = int(input())

q_500, mod_500 = divmod(X, 500)
q_5, mod_5 = divmod(mod_500, 5)

print(q_500*1000+q_5*5)

Submission status: Accepted

Solution code:
X = int(input())
A = X // 500
B = X - A * 500
C = B // 5

print(1000 * A + 5 * C)

Submission status: Accepted

Solution code:
b = int(input())
cur = [500, 5]
ans = 0
for ele in cur:
    if ele == 500:
        ans += (b // ele) * 1000
    else:
        ans += (b//ele) * 5
    b = b % ele
print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

x=ii()
ans=0
p=x//500
ans+=p*1000

x-=p*500
if x>=0:
    q=x//5
    ans+=q*5

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
X = int(input())
count = 0
while X >= 500:
    X -= 500
    count += 1000
while X >= 5:
    X -= 5
    count += 5
print(count)

Submission status: Accepted

Solution code:
x = int(input())

a = x //500

x = x - (500*(x//500))

b = x//5

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

t = n
s = 0
while t - 500 >= 0:
  t = t - 500
  s = s + 1000
  
while t - 5 >= 0:
  t = t - 5
  s = s + 5
  
print(s)

Submission status: Accepted

Solution code:
X = int(input())

n_500 = 0
n_5 = 0

while True:
    if X // 500 != 0:
        n_500 += 1
        X -= 500
    else:
        break

while True:
    if X // 5 != 0:
        n_5 += 1
        X -= 5
    else:
        break

print(1000*n_500 + 5*n_5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input().strip())

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

print(ans)

Submission status: Accepted

Solution code:
x = int(input())

num_500 = x // 500

mod_500 = x - num_500 * 500

num_5 = mod_500 // 5

print(1000 * num_500 + 5 * num_5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
  ans = 0
  x = int(input())
  b = x // 500
  ans += 1000 * b
  x -= 500 * b
  b += x // 5
  ans += (x // 5) * 5
  print(ans)
  return 0
 
if __name__ == "__main__":
  solve()

Submission status: Accepted

Solution code:
X=int(input())

a=X//500
nx=X%500
b=nx//5

print(a*1000+b*5)

Submission status: Accepted

Solution code:
x = int(input())

num_fivehand = x // 500
num_five = (x % 500) // 5

print(num_fivehand * 1000 + num_five * 5)

Submission status: Accepted

Solution code:
#input
X = int(input())

#output
a = X//500
b = (X - 500*a)//5

print(1000 * a + 5 * b)

Submission status: Accepted

Solution code:
X = int(input())

def calculate(x):
    a = x // 500
    b = x % 500

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


calculate(X)

Submission status: Accepted

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

print(main())

Submission status: Accepted

Solution code:
X = int(input())


p = X // 500
mod = X % 500

q = mod//5

ans = p*1000 + q*5

print(ans)

Submission status: Accepted

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

a = x // 500
happy = 1000 * a

rest = x - 500 * a

b = rest // 5
happy += 5 * b

print(happy)

Submission status: Accepted

Solution code:
x=int(input())

coin=[500,5]
point=[1000,5]
ans=0

for i in range(2):
    ans+=(x//coin[i])*point[i]
    x %=coin[i]

print(ans)

Submission status: Accepted

Solution code:
x=int(input())
re_500=x//500
re_50=(x-(500*re_500))//5

print(re_500*1000+re_50*5)

Submission status: Accepted

Solution code:
X = int(input())
gh = X // 500
gha = X % 500
ge = gha // 5

ans = gh * 1000 + ge * 5
print(ans)

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc160/tasks/abc160_b
# -*- coding: utf-8 -*-
X = int(input())
A = X//500
amari = X-A*500
B = amari//5
print(A*1000+B*5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

result = 0
while True:
    if x - 500 >= 0:
        x -= 500
        result += 1000
    elif x - 5 >= 0:
        x -= 5
        result += 5
    else:
        break

print(result)

Submission status: Accepted

Solution code:
X=int(input())

sum=X
coin=[500,5]
x=[]
for i in range(2):
    x.append(int(X/coin[i]))
    X=X%coin[i]

print(x[0]*1000+x[1]*5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

a = x // 500
b = x % 500

c = b // 5

cnt = a * 1000 + c * 5

print(cnt)

Submission status: Accepted

Solution code:
X = int(input())
ans = 0
coin = [500, 5]
while X >= 500:
    a, b = divmod(X, 500)
    ans += 1000 * a
    X = b
while X >= 5:
    a, b = divmod(X, 5)
    ans += 5 * a
    X = b
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())

b = a//500
c = a - b*500
d = c // 5
print(b*1000+d*5)

Submission status: Accepted

Solution code:
money = int(input())

coin500 = money // 500

coin5 = (money % 500) // 5

print(coin500 * 1000 + coin5 * 5)

Submission status: Accepted

Solution code:
x = int(input())

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

print(a*1000+b*5)

Submission status: Accepted

Solution code:

N = int(input())

A = N//500
B = N % 500

C = B // 5

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())
coins = [500, 5]
joy = 0
for coin in coins:
  val = x // coin
  x = x % coin
  if coin == 500:
    joy += val * 1000
  elif coin == 5:
    joy += val * 5
print(joy)

Submission status: Accepted

Solution code:
money = int(input())

tem_1 = money // 500
money_2 = money % 500
tem_2 = money_2 // 5
ans = 1000*tem_1 + 5*tem_2
print(ans)

Submission status: Accepted

Solution code:
x = int(input())
q,mod=divmod(x,500)
b = mod//5
print(q*1000+b*5)

Submission status: Accepted

Solution code:
X = int(input())

fiveh_yen = X // 500
five_yen = (X - fiveh_yen * 500) // 5

print(fiveh_yen * 1000 + five_yen * 5)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

ans+=(x//500)*1000
x=x-((x//500)*500)

ans+=(x//5)*5

print(ans)

Submission status: Accepted

Solution code:
X=int(input())
H1=0
H2=0
H1 += X // 500
X2 = X%500
H2 += X2 // 5

print(500*2*H1 + 5*H2)

Submission status: Accepted

Solution code:
X = int(input())
uresisa = 0
while True:
    if X >= 500000:
        X -= 500000
        uresisa += 1000000
    else:
        break

while True:
    if X >= 500:
        X -= 500
        uresisa += 1000
    else:
        break
while True:
    if X >= 5:
        X -= 5
        uresisa += 5
    else:
        break

print(uresisa)

Submission status: Accepted

Solution code:
X = int(input())

FH = X//500
F = X%500//5

print(FH*1000+F*5)

Submission status: Accepted

Solution code:
X = int(input())

a = X // 500
b = X % 500 
c = b // 5

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
yen = int(input())

pleasure = (yen // 500) * 1000
yen = yen % 500
pleasure += (yen // 5) * 5

print(pleasure)

Submission status: Accepted

Solution code:
X = int(input())
q, r = divmod(X, 500)
print(q * 1000 + (r // 5) * 5)

Submission status: Accepted

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


main()

Submission status: Accepted

Solution code:
X = int(input())

n500 = X // 500
amari = X - n500 * 500
n5 = amari // 5
ureshi = n500 * 1000 + n5 * 5

print(ureshi)

Submission status: Accepted

Solution code:
x=int(input())

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

print(happy)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

h = (X // 500)*1000 + ((X-500 * (X//500)) // 5) *5

print(h)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

h1 = x // 500
h5 = (x - h1 * 500) // 5

print(h1 * 1000 + h5 * 5)

Submission status: Accepted

Solution code:
#B - Golden Coins
X = int(input())

ans1 = X // 500
ans2 = (X - 500*ans1)//5

print(ans1*1000+ans2*5)

Submission status: Accepted

Solution code:
X = int(input())
cnt = 0
while X >= 500:
    X = X - 500
    cnt += 1000
while X >= 5:
    X = X - 5
    cnt += 5
print(cnt)

Submission status: Accepted

Solution code:
import math

X = int(input())

print(math.floor(X/500)*1000 + math.floor((X-500*math.floor(X/500))/5)*5)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
X = int(input())

n500 = int(X/500)
n5 = int((X % 500)/5)

sum = 1000*n500 + 5*n5

print(sum)

Submission status: Accepted

Solution code:
a = int(input())

_a500 = a // 500
_a5 = (a % 500) // 5

print( _a500*1000 + _a5*5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

gohyaku = X//500
goen = (X - gohyaku*500)//5

ans = gohyaku * 1000 + goen * 5
print(ans)

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
money = int(input())

five_hundred_yen = money//500
happiness = five_hundred_yen * 1000
money -= five_hundred_yen*500
five_yen = money//5
happiness += five_yen*5

print(happiness)

Submission status: Accepted

Solution code:
n=int(input())
a=0
while n>499:
  n-=500
  a+=1000
while n>4:
  n-=5
  a+=5
print(a)

Submission status: Accepted

Solution code:
x = int(input())

x_s = x // 500
x_a = x % 500

x_ss = x_a // 5

ans = x_s*1000 + x_ss*5

print(ans)

Submission status: Accepted

Solution code:
X=int(input())
dai = int(X/500)
sa=X-dai*500
sho = int(sa/5)

ans = dai*1000 + sho*5
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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


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

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

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


if __name__=="__main__":
	inputs=getInputs()
# 	inputs=simInputs()
	main(inputs)

Submission status: Accepted

Solution code:
amount = int(input())

print(int(amount / 500)* 1000 + int(int(amount % 500) / 5) * 5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

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


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

Submission status: Accepted

Solution code:
X=int(input())
a,mod=divmod(X,500)
b,mod=divmod(mod,5)

print(1000*a+5*b)

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 160: B (2020/03/28)
X = int(input())
x500 = X//500
x005 = (X-(500*x500))//5
print(1000*x500+5*x005)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
I=lambda:list(map(int,input().split()))
n,=I()
x=n//500
y=n-(x*500)
x*=1000
y=y//5
y*=5
print(x+y)

Submission status: Accepted

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

h1=math.floor(x/500)
x2=x % 500
h2=math.floor(x2/5)
print(h1*1000+h2*5)

Submission status: Accepted

Solution code:
import sys

X = int(sys.stdin.readline().rstrip())
a = X // 500
X = X % 500
b = X // 5

print(a * 1000 + b * 5)

Submission status: Accepted

Solution code:
x = int(input())
joy500, mod = divmod(x, 500) 
joy5 = mod // 5
joy = 1000*joy500 + 5*joy5
print(joy)

Submission status: Accepted

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

Submission status: Accepted

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

X = int(input())

ans = 0
for (val, happiness) in [(500, 1000), (5, 5)]:
    num = X // val
    ans += num * happiness
    X -= num * val

print(ans)

Submission status: Accepted

Solution code:
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def main():
    X = int(input())

    res = 1000 * (X // 500)
    X %= 500
    res += 5 * (X // 5)

    print(res)



main()

Submission status: Accepted

Solution code:
X = int(input())

myans = 0

myans += X//500 * 1000
#print(myans)
myans += (X%500)//5 * 5

print(myans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
i_str = int(input())

result,amari = divmod(i_str,500)
reult2,amari2 = divmod(amari,5)

print(result*1000 + reult2*5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

a = N//500
b = N%500

print(a*1000+(b//5)*5)

Submission status: Accepted

Solution code:
x = int(input().rstrip())

ans = 0
c1 = int(x / 500)
ans = c1 * 1000
x -= c1 * 500
c2 = int(x / 5)
ans += c2 * 5

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

happy = 0
happy += int((X//500)*1000)
amari = int(X%500)
happy += int((amari//5)*5)
print(happy)

Submission status: Accepted

Solution code:
c=int(input())

f=int(c/500)

s=int((c-f*500)/5)

print((f*1000)+(s*5))

Submission status: Accepted

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

###
# main
if(__name__ == '__main__'):
    # input
    x = int(input())

    n500 = x // 500
    n5 = (x-500*n500) // 5

    ans = n500 * 1000 + n5 * 5

    print(ans)
# else:
    # do nothing

Submission status: Accepted

Solution code:
N = int(input())
a = 0
b = 0

if N  // 500 > 0:
    a = N //500
    N = N % 500
if N // 5 > 0:
    b = N //5
print(a*1000 + b*5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import math
import itertools
import statistics
#import collections
x = int(input())
#A = (map(int, input().split()))

total = 0
total += (x//500) *1000
x = x%500

total += (x//100)* 20 *5
x = x%100
total += (x//50) *10*5
x = x%50
total += (x//10) * 2*5
x = x%10
total += (x//5) *5

print(total)

Submission status: Accepted

Solution code:
X = int(input())

a = X // 500

next = X - 500 * a

b = next // 5

print(1000 * a + 5 * b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = int(input())
fh = 0
f = 0
fh = s//500
s = s - 500 * fh
f = s//5

print(fh*1000 + f*5)

Submission status: Accepted

Solution code:
import sys
X = int(input())
okane = X

senpoint = (X // 500)
okane = okane - (senpoint*500)
gopoint = (okane//5)

print((senpoint*1000) + (gopoint*5))

Submission status: Accepted

Solution code:
yen = int(input())

# 500円玉の枚数
A = yen // 500
# 5円玉の枚数
B = (yen-A*500) // 5

# 価値
value = A*1000+B*5

print(value)

Submission status: Accepted

Solution code:
n = int(input())
dummy1,dummy2 = divmod(n,500)
dummy3 = dummy2 // 5
print(dummy1*1000+dummy3*5)

Submission status: Accepted

Solution code:
X = int(input())

hp1000 = X // 500
hp5 = (X - 500 * hp1000) // 5

ans = 1000 * hp1000 + 5 * hp5
print(ans)

Submission status: Accepted

Solution code:
X = int(input())

gohyaku = X//500
nokori = X % 500
goen = nokori//5

print(gohyaku*1000 + goen*5)

Submission status: Accepted

Solution code:

import collections


def solve(X):
    x1000 = X // 500
    happiness = x1000 * 1000

    rem = X - x1000 * 500

    happiness += ((rem // 5) * 5)

    return happiness


X = int(input().strip())
print(solve(X))

Submission status: Accepted

Solution code:
x = int(input())
ans500 = divmod(x, 500)
ans5 = divmod(ans500[1], 5)
print(ans500[0] * 1000 + ans5[0] * 5)

Submission status: Accepted

Solution code:
x = int(input())

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

d = a*1000+c*5

print(d)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''
#codeforces
gi = lambda : list(map(int,input().split()))
n, = gi()
print(1000 * (n // 500) + ((n % 500) // 5) * 5)

Submission status: Accepted

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

x = int(input())

goh = int(x / 500)

go = int((x - (500*goh)) / 5)


print("{}".format(goh*1000+go*5))

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

a = X//500
b = X%500
c = b//5

a = a*1000
c = c*5

print(a+c)

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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