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

num_500 = money // 500;
mod = money % 500;
num_5 = mod // 5;

point = num_500 * 1000 + num_5 * 5;

print(point)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

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

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

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

Submission status: Accepted

Solution code:
X = int(input())

joy = 0
joy = int(X / 500) * 1000
remainder = X % 500
joy += int(remainder / 5) * 5

print(joy)

Submission status: Accepted

Solution code:
import sys

X= int(input())

Happy = 0

q,mod = divmod(X,500)
Happy += q * 1000

q,mod = divmod(mod,5)
Happy += q * 5

print(Happy)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

x = int(input())

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

c2 = x // 5

print(c1*1000 +c2*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())

n1 = 0
while True:
    x = x - 500
    if x < 0:
        x += 500
        break
    else:
        n1 += 1

n2 = 0
while True:
    x = x - 5
    if x < 0:
        x += 5
        break
    else:
        n2 += 1

print(n1*1000 + n2*5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    X = int(input())
    goyaku = X // 500
    go = (X - (goyaku * 500)) // 5

    print((goyaku * 1000) + (go * 5))

resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m = int(input())

happy = 0

fh = m // 500
m = m % 500

f = m // 5

happy = fh * 1000 + f*5

print(happy)

Submission status: Accepted

Solution code:
c=int(input())
bigcoins=c//500
rcoins=c%500
scoins=rcoins//5
print(bigcoins*1000+scoins*5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())

num500=x//500
remain=x-num500*500

num5=remain//5

print(num500*1000+num5*5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

d, m = divmod(X, 500)
print(d * 1000 + (m // 5) * 5)

Submission status: Accepted

Solution code:
x = int(input())

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
Yen = int(input())
Yen_500 = Yen//500
nokori = Yen - Yen_500*500
Yen_5   = nokori//5

print(Yen_500*1000+Yen_5*5)

Submission status: Accepted

Solution code:
x = int(input())

big = x // 500
small = (x - big*500) // 5

print(big * 1000 + small * 5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
def happy(n):
  hap500 = (n // 500) * 1000
  n = n % 500
  hap5 = (n // 5) * 5
  return hap500 + hap5

string = int(input())
print(happy(string))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
count500 = 0
count5 = 0
while x >= 500:
    x -= 500
    count500 += 1
while x >= 5:
    x -= 5
    count5 += 1

print(count500 * 1000 + count5 * 5)

Submission status: Accepted

Solution code:
n =int(input())
a= 500
b = 5
sum = 0
if(n%a==0):
  sum = n*2
else:
  sum = (1000*(n//a)) + 5*((n%a)//b)
  
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

if x%500==0:
    point = (x/500)*1000
else:
    res = x
    point = 0
    while res > 500:
        point = point + 1000
        res = res - 500
    point= point + (res//5)*5
        
print(int(point))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math as ma
X=int(input())
super=ma.floor(X/500)
Y=X-super*500
minus=ma.floor(Y/5)
tot=1000*super+5*minus
print(tot)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
count_500 = X // 500
count_5 = (X % 500) //5

print(count_500*1000+count_5*5)

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:
num0=int(input())
sum0=0
high=int((num0-num0%500)/500)
date0=num0-high*500
low=int((date0-date0%5)/5)
print(high*1000+low*5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
d=n//500
e=n%500
f=e//5
print(d*1000+f*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())
uresisa = 1000 * (x // 500) + 5 * ((x % 500) // 5)
print(uresisa)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

y = 1000*a + 5*b

print(y)

Submission status: Accepted

Solution code:
x = int(input())

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

bronze = x // 5

print(gold*1000 + bronze*5)

Submission status: Accepted

Solution code:
money = int(input())
golden = money // 500

money -= golden*500
bronze = money //5

score = golden*1000 + bronze*5
print(score)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = 0
while n - 5 > 0:
  if n - 500 >= 0:
    n -= 500
    s += 1000
  elif n - 100 >= 0:
    n -= 100
    s += 100
  elif n - 50 >= 0:
    n -= 50
    s += 50
  elif n - 10 >= 0:
    n -= 10
    s += 10
  elif n - 5 > 0:
    n -= 5
    s += 5
  #elif n - 1 >= 0:
   # n -= 1
   # s += 1
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
a=0
b=0
while 500*(a+1)<=x:
    a+=1
    continue
while 5*(b+1)<=x-500*a:
    b+=1
    continue
print(1000*a+5*b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

happiness = (x//500)*1000
x = x%500
happiness += (x//5)*5

print(happiness)

Submission status: Accepted

Solution code:
import math
X=int(input())
a=math.floor(X/500)
b=int(X%500)

c=math.floor(b/5)

print(a*1000+c*5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
x -= x % 5
gohyaku = x - x % 500
go = x % 500
print(gohyaku * 2 + go)

Submission status: Accepted

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

Submission status: Accepted

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

print(S + T)

Submission status: Accepted

Solution code:
x = int(input())

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

print(1000*a + 5*b)

Submission status: Accepted

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

print(((a - b)*2) + b - c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

u = X // 500
X %= 500
v = X // 5

print(u * 1000 + v * 5)

Submission status: Accepted

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

while X >= 500:
  X = X - 500
  gold += 1000

while X >= 5:
  X = X - 5
  gold += 5

print(gold)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
# import sys
# sys.setrecursionlimit(10 ** 6)
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 LLI(rows_number): return [LI() for _ in range(rows_number)]


def solve():
    x = II()
    fh = x // 500
    x = x - fh * 500
    five = x // 5
    print(1000 * fh + 5 * five)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
x = int(input())

n_500 = int(x/500)
n_5 = int((x%500)/5)

print(n_500*1000+n_5*5)

Submission status: Accepted

Solution code:
X=int(input())
if X>=500:
    y=X//500
    print(int(1000*y+(X-y*500)//5*5))
else:
    z=X//5
    print(int(z*5))

Submission status: Accepted

Solution code:
coin = int(input())
siawase = 0
if coin >= 500:
    siawase = siawase + int(coin / 500) * 1000
    amari = coin % 500
    siawase = siawase + int(amari / 5) *5
elif coin >= 5:
    siawase = siawase + int(coin / 5) * 5
    
print(int(siawase))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

hM = X//500*1000
hT = (X - hM//2)//5*5
print(hM+hT)

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

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

print(happy)

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:
coins=int(input())
happiness=0
while coins>=5:
  if coins>=500: 
    happiness+=1000
    coins-=500
  elif coins>=5:
    happiness+=5
    coins-=5
print(happiness)

Submission status: Accepted

Solution code:
X=int(input())
P,Q=divmod(X,500)
R,S=divmod(Q,5)
print(P*1000+R*5)

Submission status: Accepted

Solution code:
#B

X = int(input())

yen500 = X//500

yen5 = (X-yen500*500)//5

print(1000*yen500 + 5*yen5)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
import math
import fractions

n = int(stdin.readline().rstrip())

x = int(n / 500)
y = int(int(n % 500) / 5)

print(x * 1000 + y * 5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())

uresisa1=X//500*1000
uresisa2=(X-X//500*500)//5*5

print(uresisa1+uresisa2)

Submission status: Accepted

Solution code:
def resolve():
    x=int(input())
    ans=0
    while x>=500:
        x-=500
        ans+=1000
    while x>=5:
        x-=5
        ans+=5
    print(ans)
resolve()

Submission status: Accepted

Solution code:
n = int(input())
happy = 0
if n%500 == 0:
    print(2*n)
else:
    while n > 0:
        if n == 0:
            break
        n-=500
        if n<0:
            n+=500
            n-=5
            if n<0:
                n+=5
                break
            else:
                happy+=5
        else:
            happy+=1000
    print(happy)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())
A , B = divmod(X,500)
C = B//5

HAPPY = A*1000 + C*5

print(HAPPY)

Submission status: Accepted

Solution code:
x = int(input())

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

if X % 500 == 0:
    print((X // 500) * 1000)
else:
    print((X // 500) * 1000 + ((X % 500) // 5) * 5)

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
a, m = divmod(x, 500)
b, _ = divmod(m, 5)
ans = a * 1000 + b * 5
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import itertools
import bisect
from operator import itemgetter
 
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
ans = 0
ans += N//500 * 1000
N -= N//500 * 500
ans += N//5 * 5
print(ans)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

x = ni()

ans = x // 500 * 1000
x %= 500
ans += x // 5 * 5

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    X = int(input())
    A = X // 500 * 1000 + X % 500 // 5 * 5
    print(A)

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())
d, m = divmod(X, 500)
ans = d * 1000
d, m = divmod(m, 5)
ans += d * 5
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
X = int(input())
def func(X, i):
    a_i, X = X//i, X - X//i * i
    return a_i, X
a_500, X = func(X, 500)
#a_100, X = func(X, 100)
#a_50, X = func(X, 50)
#a_10, X = func(X, 10)
a_5, X = func(X, 5)
#a_1, X = func(X, 1)
print(a_500 * 1000 + a_5 * 5)

Submission status: Accepted

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

ans += (X // 5) * 5

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
q,r=divmod(x,500)
y500=q
q,r=divmod(r,5)
y5=q
print(1000*y500+5*y5)

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


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import permutations
import sys

sys.setrecursionlimit(10 ** 6)
from bisect import *
from collections import *
from heapq import *

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    x=II()
    c,x=divmod(x,500)
    ans=c*1000+x//5*5
    print(ans)

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())

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

Submission status: Accepted

Solution code:
X = int(input())

A = X // 500
B = X % 500
C = B // 5

print(A*1000+C*5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
x = n//500
n -= x*500
print(x*1000 + (n//5)*5)

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
a1, r1 = divmod(x, 500)
r2 = r1 // 5
print(a1*1000 + r2*5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
u,v=divmod(x,500)
s,t=divmod(v,5)
print(1000*u+5*s)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
X = int(input())
print(X // 500 * 1000 + (X % 500) // 5 * 5)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    x = int(input().rstrip('\n'))
    print(x // 500 * 1000 + (x - x // 500 * 500) // 5 * 5)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    X = int(input())
    
    res = 1000 * (X // 500)
    X = X % 500
    res += 5 * (X // 5)

    print(res)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())

p500 = X//500
p5 = X%500 //5
print(p500 *1000 + p5 *5)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 19 11:55:12 2020

@author: 17664
"""
happy = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#Golden Coins
cost_1 = int(input())

numbers_500 = int(cost_1 / 500)
cost_2 = cost_1 - (numbers_500 * 500)

numbers_5 = int(cost_2 / 5)
cost_3 = cost_2 - (numbers_5 *5)

#print(numbers_500, numbers_5)
#print(cost_1, cost_2, cost_3)
print(int(numbers_500*1000 + numbers_5*5))

Submission status: Accepted

Solution code:
okane = input()
okane = int(okane)
shiawase1 = okane // 500
okane = okane - shiawase1 * 500
shiawase2 = okane // 5
okane = okane - shiawase2 * 5
shiawase = shiawase1 * 1000 + shiawase2 * 5
print(shiawase)

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:
# coding: utf-8
# Your code here!

x = int(input())

happy_1 = (x // 500) * 1000
happy_2 = ((x % 500) // 5) * 5

print(happy_1 + happy_2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
X = a[0]

p = X%500
P = (X-p)*2

q = p%5
Q = p-q

print(P+Q)

Submission status: Accepted

Solution code:
x = int(input())

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

print(res)

Submission status: Accepted

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

x = int(input())

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

print(n500*1000+n5*5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())

s=int(X/500)#500円だまの枚数
X=X-500*s
t=int(X/5)#五円玉の枚数

print(s*1000+t*5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
# a: number of 500 yen coin
a = x//500
# b: the money left
b = x - 500*a
# c: number of 5 yen coin
c = b//5
happiness = (a * 1000) + (c * 5)
print(happiness)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc160/tasks/abc160_b
X = int(input())
happiness = 0

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

print(a * 1000 + b * 5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m = int(input())

p = m//500*1000 + m%500//5*5

print(p)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

i = int(X / 500)
X = X - (i * 500)
happy += i * 1000

i = int(X / 5)
X = X - (i * 5)
happy += i * 5

print(str(happy))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
total = int(input())
num_500 = total // 500

remain = total - num_500 * 500
num_5 = remain // 5

print(num_500 * 1000 + num_5 * 5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
money=int(input())
fhy=money//500
fy=(money%500)//5
gp=fhy*1000+fy*5
print(gp)

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    res_1 = x // 500
    y = x % 500
    res_2 = y // 5
    res = res_1 * 1000 + res_2 * 5
    print(res)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

x %= 500

happy += 5 * (int(x/5))

print(happy)

Submission status: Accepted

Solution code:
from sys import exit, stdin
X = int(stdin.readline().rstrip())
Y = X // 500
Z = X % 500
print(Y*1000 + (Z//5)*5)

Submission status: Accepted

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

happy_1 = (X // 500) * 1000
happy_2 = ((X % 500) // 5) * 5

val = happy_1 + happy_2

print(val)

Submission status: Accepted

Solution code:
X = int(input())

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