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

C = 0
P = 0
D = 0
L = 0
total = 0

if X >= 0 and X <= 10 ** 9:
    while True:
        if X > 500:
            C = X // 500
            P = 500 * C
            X = X - P
        elif X > 5:
            D = X // 5
            L = 5 * D
            X = X - L
        else:
            break

total = (1000 * C) + (5 * D)

print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
yen = int(input())
if yen < 5:
    print(0)
elif yen < 500:
    print(int(yen/5)*5)
else:
    ran = int(yen/5)*5
    if int(str(ran)[-3:])>=500:
        print((ran*2)-int(str(ran)[-2:]))
    else:
        print((ran*2)-int(str(ran)[-3:]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(1000*a + 5*c)

Submission status: Wrong Answer

Solution code:
X = int(input())

C = 0
D = 0

if X >= 0 and X <= 10 ** 9:
    while True:
        if X > 500:
            C = X // 500
            P = 500 * C
            X = X - P
        elif X > 5:
            D = X // 5
            L = 5 * D
            X = X - L
        else:
            break

total = (1000 * C) + (5 * D)

print(str(total))

Submission status: Wrong Answer

Solution code:
n=int(input())

ct = n // 1000

ost = n % 1000

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def count_section_by_zero(data):
  count = 0
  flg = False
  start = 0
  for i, d in enumerate(data):
    if flg is False and d != 0:
      count += 1
      flg = True
      
    if d == 0:
      flg = False
  return count

def input_list():
  return list(map(int, input().split()))

def input_list_str():
  return list(map(str, input().split()))

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
  x = int(input())
  x_500 = 0
  x_5 = 0
  if x >= 500:
    x_500 = x//500
    x -= x_500 * 500
    if x >= 5:
      x_5 = x//5
  print(int(x_500*1000 + x_5 *5))
import math
import fractions
import collections
import itertools
from functools import reduce
main()

Submission status: Wrong Answer

Solution code:
X = int(input())

if X == 0:
    print('高橋君は一文無しです。')
elif X > 10 ** 9:
    print('高橋君は大富豪です。')
else:
    point_thousand = X // 500
    point_five = (X - (point_thousand * 500)) // 5
    total = (point_thousand * 1000) + (point_five * 5)
    print('500円硬貨' + str(point_thousand) + '枚。5円硬貨' + str(point_five) + '枚を含むように両替することで' +
          str(total) + 'の嬉しさを得ます。これが嬉しさの最大です。')

Submission status: Wrong Answer

Solution code:
X = int(input())

C = 0
D = 0

while True:
    if X > 500:
        C = X // 500
        P = 500 * C
        X = X - P
    elif X > 5:
        D = X // 5
        L = 5 * D
        X = X - L
    else:
        break

total = (1000 * C) + (5 * D)

print(total)

Submission status: Wrong Answer

Solution code:
yen = int(input())
if yen < 5:
    print(0)
elif yen < 500:
    print(int(yen/5)*5)
else:
    ran = int(yen/5)*5
    print((ran*2)-int(str(ran)[-3:]))

Submission status: Wrong Answer

Solution code:
def count_section_by_zero(data):
  count = 0
  flg = False
  start = 0
  for i, d in enumerate(data):
    if flg is False and d != 0:
      count += 1
      flg = True
      
    if d == 0:
      flg = False
  return count

def input_list():
  return list(map(int, input().split()))

def input_list_str():
  return list(map(str, input().split()))

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
  x = int(input())
  x_500 = 0
  x_5 = 0
  if x > 500:
    x_500 = x//500
    x -= x_500 * 500
    if x > 5:
      x_5 = x//5
  print(int(x_500*1000 + x_5 *5))
import math
import fractions
import collections
import itertools
from functools import reduce
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def count_section_by_zero(data):
  count = 0
  flg = False
  start = 0
  for i, d in enumerate(data):
    if flg is False and d != 0:
      count += 1
      flg = True
      
    if d == 0:
      flg = False
  return count

def input_list():
  return list(map(int, input().split()))

def input_list_str():
  return list(map(str, input().split()))

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
  x = int(input())
  x_500 = 0
  x_5 = 0
  if x > 500:
    x_500 = x//500
    x -= x_500 * 500
    if x > 5:
      x_5 = x/5
      
  print(int(x_500*1000 + x_5 *5))
import math
import fractions
import collections
import itertools
from functools import reduce
main()

Submission status: Wrong Answer

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

C = 0
D = 0

while True:
    if X > 500:
        C = X // 500
        P = 500 * C
        X = X - P
    elif X > 5:
        D = X // 5
        L = 5 * D
        X = X - L
    else:
        break

total = (1000 * C) + (5 * D)

print(total)
print()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
all_money = int(input())

big_cnt = 0
sml_cnt = 0

all_money_mod = all_money

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

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

Submission status: Wrong Answer

Solution code:
import math
import fractions

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

def ValueToBits(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res

def BitsToValue(arr):
    n = len(arr)
    ans = 0
    for i in range(n):
        ans+= arr[i] * 2**i
    return ans

def ValueToArray10(x, digit):
    ans = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        ans[digit-i-1] = now%10
        now = now //10
    return ans
'''
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 2
N = 10 ** 6 + 2
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

'''

#a = list(map(int, input().split()))

n = int(input())

ans = 0

ans += (n//500)*1000

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

print(ans)

Submission status: Wrong Answer

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

a = 0
b = 0
C = 0
D = 0

while True:
    if X > 500:
        C = X // 500
        P = 500 * C
        X = X - P
    elif X > 5:
        D = X // 5
        L = 5 * D
        X = X - L
    else:
        break

total = 1000 * C + 5 * D
print(total)

Submission status: Wrong Answer

Solution code:
money = int(input("input the amount "))
n = (500, 5)
res = 0
res1 = 0
ans = 0
moneys = money
for N in n:
    if money>=500:
        count, money = divmod(money, N)   
        res = (N * 2) * count
        
    elif money < 500: 
        count, money = divmod(money, N)
        res1 = (N*count)
    ans = res + res1    
print(ans)

Submission status: Wrong Answer

Solution code:
yen = int(input())
if yen < 5:
    print(0)
elif yen < 500:
    print(int(yen/5)*5)
else:
    ran = int(yen/5)*5
    print((ran*2)-int(str(ran)[-2:]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inp = input()
inp = int(float(inp))
aaa = 0
bbb = 0
yyy = 0

if 0 <= inp and inp <= 10**9:
  if 500 <= inp:
    big = inp // 500
    aaa = big * 1000
    amari = inp % 500
    if 5 <= amari:
      smo = amari //5
      bbb = smo *5
    print(aaa+bbb)
  elif 5 <= inp:
    hhh = inp // 5
    yyy = hhh * 5
    print(yyy)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
X = int(input('Enter Input: '))
if X > 5:
    a = int(X/500)
    b = X % 500
    c = int(b/5)
    d = a * 1000 + c * 5
    print(d)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
money = int(input("input the amount "))
n = (500, 5)
res = 0
ans = 0
for N in n:
    count, money = divmod(money, N)
    if count:
        
        res = (N * 2) * count
        ans +=res
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
inp = input()
inp = int(float(inp))
aaa =0
bbb =0
nega = 0
big = 0

if 0 <= inp and inp <= 10**9:
    if 500 <= inp:
        big = (inp // 500)
        sma = big % 500
        if 5 <= sma:
          nega = (sma // 5)
      
        aaa = 1000*big
        bbb = 5*nega
        print(aaa + bbb)
    elif 5 <= inp:
        nega = (inp // 5)
        bbb = 5*nega
        print(bbb)
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
coininput = input()
last = coininput
coininput = int(coininput)
fivehunred = 0
onehunred = 0
fifty = 0
ten = 0
five = 0
if coininput >= 0 and coininput <= 1000000000:
    fivehunred = round(coininput / 500) * 1000
    onehunred = round(round(coininput % 500) / 100)
    fifty = round(round(coininput % 100) / 50) * 50
    ten = round(round(coininput % 50) / 10) * 10
    if int(last[len(last) - 1]) >= 5:
        five = round(round(coininput % 10) / 5)
    else:
        five = 0
    if onehunred >= 5:
        fivehunred = fivehunred + 1000
        onehunred = (onehunred - 500) * 100
    else:
        onehunred = onehunred * 100
    total = fivehunred + onehunred + fifty + ten + five
    print(total)
else:
    print()

Submission status: Wrong Answer

Solution code:
X = int(input())
A = 0
B = 0

A = X - X % 500
A500 = A / 500 * 1000
A5 = (X % 500) % 5 * 5
A = int(A500) + int(A5)

B = (X - X % 5)
B = int(B / 5 * 5)
print(int(max(A, B)))

Submission status: Wrong Answer

Solution code:
inp = input()
inp = int(float(inp))
aaa =0
bbb =0
nega = 0
big = 0

if 0 <= inp and inp <= 10**9:
  if 500 <= inp:
    big = (inp // 500)
    sma = big % 500
    if 5 <= sma:
      nega = (sma // 5)
      
  aaa = 1000*big
  bbb = 5*nega
  print(aaa + bbb)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
a=int(input())
if a % 500 == 0:
  print(a * 2)
else:
  if a < 1000:
    print(int(a/500) * 1000 + int((a % 500) / 5) * 5)
  else:
    print(round(a,-2) * 2 + int((a % 500) / 5) * 5)

Submission status: Wrong Answer

Solution code:
inp = input()
inp = int(float(inp))
aaa =0
bbb =0
nega = 0
big = 0

if 0 <= inp and inp <= 10**9:
  if 500 <= inp:
    big = (inp // 500)
    sma = inp-(big * 500)
    if 5 <= sma:
      nega = (sma // 5)
      
  aaa = 1000*big
  bbb = 5*nega
  print(aaa + bbb)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
I =int(input())


if I ==0:
    print(I)
    
if I>=500:
    J=I//500
    
    K=J*500*2#
    
    
    P=I-500*J
    if P==0:
        print(K)
    
    if P>=5:
        Q=P//5
        R=Q*5#
        
        A=K+R
        print(A)

if I<500:
        M=I//5
        A=M*5#
        
        
        print(A)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
if (X > 0) and (X <= 10**9):
    H = X // 500
    G = (X - (H * 500)) // 5
    Y = (H * 1000) + (G * 5)
    print(Y)

Submission status: Wrong Answer

Solution code:
inp = input()
inp = int(float(inp))
aaa =0
bbb =0
nega = 0
big = 0

if 0 <= inp and inp <= 10**9:
  if 500 <= inp:
    big = (inp // 500)
    sma = inp-(big * 500)
    if 5 <= sma:
      nega = (sma // 5)
      
  aaa = 1000*big
  bbb = 5*nega
  print(aaa + bbb)

Submission status: Wrong Answer

Solution code:
coininput = input()
last = coininput
coininput = int(coininput)
fivehunred = 0
onehunred = 0
fifty = 0
ten = 0
five = 0
if coininput >= 0 and coininput <= 1000000000:
    fivehunred = round(coininput / 500) * 1000
    onehunred = round(round(coininput % 500) / 100) * 100
    fifty = round(round(coininput % 100) / 50) * 50
    ten = round(round(coininput % 50) / 10) * 10
    if int(last[len(last) - 1]) >= 5:
        five = round(round(coininput % 10) / 5)
    else:
        five = 0
    total = fivehunred + onehunred + fifty + ten + five
    print(total)
else:
    print()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
I =int(input())


if I ==0:
    print(I)
    
if I>=500:
    J=I//500
    
    K=J*500*2#
    print(K)
    
    P=I-500*J
    if K==0:
        print(K)
    
    if P>=5:
        Q=P//5
        R=Q*5#
        
        A=K+R
        print(A)

if I<500:
        M=I//5
        A=M*5#
        
        
        print(A)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


print(fivet_yen + five_yen)

Submission status: Wrong Answer

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


print(fivet_yen + five_yen)

Submission status: Wrong Answer

Solution code:
X = int(input())
A = 0
B = 0

A = X - X % 500
A500 = A / 500 * 1000

A5 = (X % 500) % 5 * 5
A = A500 + A5

B = (X - X % 5)
B = B / 5 * 5
print(int(max(A, B)))

Submission status: Wrong Answer

Solution code:
import math
x = input()
if len(x) > 2:
    y = int(x)/100
    y = math.floor(y)
    a = (y * 200) + (int(x[-2])*10)
    print(a)
elif len(x) == 1:
    print(0)

Submission status: Wrong Answer

Solution code:
X = int(input())
if X % 5 ==0 and X > 500:
        print(X*2)
elif X > 500 and not X % 5 == 0:
    A = X // 10
    A = A*10
    print(A*2)
elif X < 500 and not X % 5 ==0:
    print(X)
elif X <= 5:
    print(X)
elif X < 5:
    print(0)

Submission status: Wrong Answer

Solution code:
X = int(input())
i = 0
fain = 0

while i == 0:
    if 5 <= X:
        if 500 <= X:
            X -= 500
            fain += 1000
        X -= 5
        fain += 5
    else:
        i += 1

print(fain)

Submission status: Wrong Answer

Solution code:
inp = input()
inp = int(float(inp))
aaa =0
bbb =0
nega = 0
big = 0

if 0 <= inp and inp <= 10**9:
  if 500 <= inp:
    big = int(inp / 500)
    sma = inp-(big * 500)
    if 5 <= sma:
      nega = int(sma / 5)
      
  aaa = 1000*big
  bbb = 5*nega
  print(aaa + bbb)

Submission status: Wrong Answer

Solution code:
M=int(input())
e,M=divmod(M,500)
e*=1000
e+=(M%5)*5
print(e)

Submission status: Wrong Answer

Solution code:
X = int(input())
if X % 5 ==0 and X > 500:
        print(X*2)
elif X > 500 and not X % 5 == 0:
    A = X // 10
    A = A*10
    print(A*2)
elif X < 500 and not X % 5 ==0:
    print(X)
elif X < 5:
    print(0)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
I =int(input())


if I ==0:
    print(I)
    
if I>=500:
    J=I//500
    
    K=J*500*2#
    
    
    P=I-500*J
    
    if P>=5:
        Q=P//5
        R=Q*5#
        
        A=K+R
        print(A)

if I<500:
        M=I//5
        A=M*5#
        
        
        print(A)

Submission status: Wrong Answer

Solution code:
a=int(input())
if a % 500 == 0:
  print(a * 2)
else:
  if a < 1000:
  	print(int(a/100) * 100 + int((a % 100) / 5) * 5)
  else:
    print(round(a,-2) * 2 + int((a % 500) / 5) * 5)

Submission status: Wrong Answer

Solution code:
def coin(usr_input):
	return (int(usr_input / 500) * 1000) + (int((usr_input - int(usr_input / 500) * 500) / 5) * 5)

Submission status: Wrong Answer

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



print(fivet_yen + five_yen)

Submission status: Wrong Answer

Solution code:
user_input = (eval(input()) // 500)
print(user_input * 1000 + ((user_input % 500) * 2) * 5)

Submission status: Wrong Answer

Solution code:
X = int(input())
hap_yen = int(X / 500)
to_hap_yen = hap_yen * 1000
remain_X = X - (hap_yen * 500)
remain_hap_yen = (remain_X / 5) * 5
total_hap_yen = to_hap_yen + remain_hap_yen
print(int(total_hap_yen))

Submission status: Wrong Answer

Solution code:
import math
x = input()
if len(x) > 3:
    y = int(x)/100
    y = math.floor(y)
    a = (y * 200) + (int(x[-2])*10)
    print(a)
elif len(x) == 1:
    print(0)

Submission status: Wrong Answer

Solution code:
a = int(input())
sen = a // 500
juu = (a % 500) // 5
print('{}'.format(sen*1000+juu*10))

Submission status: Wrong Answer

Solution code:
coins = [500, 5, 100, 50, 10, 1]
uresimi = {500: 1000, 5: 5}


def get_uresimi(money, coin_type):
    coin_count = money // coin_type
    if coin_count == 0:
        return 0, 0
    surplus = money % (coin_type * coin_count)
    uresisa = uresimi.get(coin_type, 0) * coin_count
    return uresisa, surplus


m = int(input())
uresii = 0
for c in coins:
    u, m = get_uresimi(m, c)
    uresii += u

print(uresii)

Submission status: Wrong Answer

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



print(fivet_yen + five_yen)

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=0
c=0
d=0
e=0
if n==0:
    print(0)
if int(n/500)>0:
    cnt=int(n/500)
    n=n%500
if int(n/100)>0:
    d=int(n/100)
    n=n%100
if int(n/50)>0:
    e=int(n/50)
    n=n%50
if int(n/5)>0:
    c=int(n/5)
    n=n%5
print(cnt*1000+c*5+d*0+e*0)

Submission status: Wrong Answer

Solution code:
X = int(input())

num_500 = X // 500
num_5 = (X - (X // 500)*500 ) % 5

print(1000*num_500 + 5 * num_5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

while S>=500:
  S -=500
  a +=1
  g =S-(500*a)
  while g>=5:
    g -=5
    b +=1
h =1000*a +5*b
print(h)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inp = int(input())
aaa =0
bbb =0
nega = 0
big = 0

if 0 <= inp and inp <= 10**9:
  if 500 <= inp:
    big = int(inp / 500)
    
    sma = inp-(big *500)
    if 5 <= sma:
      nega = int(sma / 5)
      
  aaa = 1000*big
  bbb = 5*nega
  print(aaa + bbb)

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
total_500 = 0
total_5 = 0
total_count = 0

if(X > 500):
    total_500 = math.floor(X/500)
    total_count += total_500 * 1000
    X -= total_500 * 500

if(X > 5):
    total_5 = math.floor(X/5)
    total_count += total_5 * 5
    X -= total_5 * 5

print(total_count)

Submission status: Wrong Answer

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

elif X%500 == 0:
    print(1000*(X%500))

Submission status: Wrong Answer

Solution code:
money = int(input())
big = money // 500
amari = money % 500
small = amari // 5
print(big + small)

Submission status: Wrong Answer

Solution code:
x = int(input())
result = 0
if x > 499:
    n = x // 500
    result += n * 1000
    x -= n * 500
if x > 4:
    n = x // 5
    result += n * 5
    x -= n * 5
result += x * 1
print(result)

Submission status: Wrong Answer

Solution code:
a = int("1000000000")
result = 0

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

print(result)

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=0
c=0
if n==0:
    print(0)
if int(n/500)>0:
    cnt=int(n/500)
    n=n%500
#if int(n/100)>0:
#    c=int(n/100)
#n=n%100
#if int(n/50)>0:
#    d=int(n/50)
#n=n%50
if int(n/5)>0:
    c=int(n/5)
    n=n%5
print(cnt*1000+c*5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
if (x > 0) and (x <= 10**9):
    h = x // 500
    g = (x - (h * 500)) // 5
    y = (h * 1000) + (g * 5)
    print(y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())
h=0
if a>500:
	c=a//500
	h+=c*1000
	a-=c*500
if a>5:
	d=a//5
	h+=d*5
	a-=d*500
print(h,end="")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
A = 0
#1024 - 24
A = X - X % 500
A500 = A / 500 * 1000
A5 = (X % 500) % 5 * 5
A = A500 + A5
print(int(A))

Submission status: Wrong Answer

Solution code:
temp0=int(input())
n500=int(temp0/500)
temp1=temp0-n500*500
n5=int(temp1/5)
n500*1000+n5*5

Submission status: Wrong Answer

Solution code:
x = input()

a = int(int(x)/5) 
b = int(a%200)
a = int(a/100)
print(1000*a+5*b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
ss = int(s)

s_1000 = ss / 500
print(s_1000)
s_under = ss - 500*int(s_1000)
print(s_under)
s_5 = int(s_under) / 5
print(s_5)

s_sum = 1000*int(s_1000) + 5*int(s_5)

print(s_sum)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())

i = 0

while X >= 500:
  X -= 500
  i += 1
  


ans = 1000*i + X

print(ans)

Submission status: Wrong Answer

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

if (a % 500) != 0:
    result = int(a/500) * 1000
    b = a % 500
    result += int(b/5) * 5

print(result)

Submission status: Wrong Answer

Solution code:
s=int(input())
h=0
while True:
    if s>=500:
        a=s//500
        h =1000*a
        s=s%500
        
    else:
        h += int(s)
        break
print(str(h))

Submission status: Wrong Answer

Solution code:
a=int(input())
if a % 500 == 0:
  print(a * 2)
else:
  print(round(a,-2) * 2 + int((a % 500) / 5) * 5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:
X = int(input())

a = X * 0.01 // 5 

pointa = a * 1000

b = X - a * 500


pointb = b // 5 * 5



print(pointa + pointb)

Submission status: Wrong Answer

Solution code:
x = int(input())

five_hundred_cnt = 0
five_cnt = 0

if x > 500:
    five_hundred_cnt = x // 500
    x %= 500
if x > 5:
    five_cnt = x // 5

print(1000*five_hundred_cnt + 5*five_cnt)

Submission status: Wrong Answer

Solution code:
X = int(input())
count_five_hundred = int(X // 500)
count_five = int((X % 1000) // 5)

max_happiness = count_five_hundred * 1000 + count_five * 5

print(max_happiness)

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
ans = 0
if math.floor(x/500) >=1 :
    ans += math.floor(x/500)*1000
    x -= math.floor(x/500)*500
if x > 0 and math.floor(x/5) >=1 :
    print("a")
    ans +=  math.floor(x/5)*5
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

happy = 0

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

a = x-(a*500)
happy += a*5

print(happy)

Submission status: Wrong Answer

Solution code:
X=int(input())

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

Submission status: Wrong Answer

Solution code:
import math
def main():
    # arg = getInput(input())
    arg = getInput(1024)
    ans = process(arg)
    print(ans)
    
def process(arg):
    yen500 = math.floor(arg / 500)
    amari = arg % 500
    yen5 = math.floor(amari / 5)
    ans = 1000 * yen500
    ans = ans + yen5 * 5

    return ans

def getInput(input):
    # 行数
    n = 1
    # 戻り値
    ret = None

    if n == 1:
        pass
        # ret = input
        # ret = list(input)
        ret = int(input)
        # ret = input.split()
        # ret = list(map(int, input.split()))
        # ret = input.split('T')
    else:
        for x in range(n):
            # 取得したい形式に変換
            ret = input[x]

    return ret

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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