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:
coins = int(input())
happiness = 0


def happiness_point(remainder, num, point, all_point):
    result = divmod(remainder, num)
    all_point += result[0] * point
    remainder = result[1]
    return remainder, all_point


if coins / 500 > 1:
    coins, happiness = happiness_point(coins, 500, 1000, happiness)

if coins / 5 > 1:
    coins, happiness = happiness_point(coins, 5, 5, happiness)

print(happiness)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

gh = X//500
g = X%500//5

print(gh * 1000 + g * 1)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

while n > 500:
    n -= 500
    ans += 1000
while n > 5:
    n -= 5
    ans += 5

print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())
cnt=0
while (not X == 0) and (X%500==0) or (X%5==0):
  if X%500==0:
    cnt+=1000
    X - 500
  elif X%5 == 0:
    cnt+=5
    X-5
  else:
    break
    
print(cnt)

Submission status: Wrong Answer

Solution code:
X = int(input())
counta = 0
countb = 0
while X%500 == 0:
  counta +=1
  X//=500
  
while X%5==0:
  countb +=1
  X//=5
print(1000*counta+5*countb)

Submission status: Wrong Answer

Solution code:
def coin(X):
  if X > 10^9 and type(X) != int:
    return None
  else:
    currency = [500, 100, 50, 10, 5, 1]
    n_coins = []
    k = X//currency[0]
    n_coins.append(k)
    X = X - k*currency[0]
    f = X//currency[4]
    n_coins.append(f)
    print(n_coins)
    hap = 1000*n_coins[0] + 5*n_coins[1]
    return hap

Submission status: Wrong Answer

Solution code:
money = int(input())

max500 = money // 500
rem500 = money % 500

max5 = money // 5

happiness = max500 * 1000 + max5 * 5

print(happiness)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
yenb = 0
yens = 0
while x - 500 > 0:
  x -= 500
  yenb += 1
while x - 5 > 0:
  x -= 5
  yens += 1
print((yens*5)+(yenb*1000))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

def main():
	happy_count = 0
	money = int(input())
	str_money = str(money)
	happy_count = (money // 500) * 1000
	str_money = str_money[-2:]
	happy_count += (int(str_money)//5) * 5
	print(happy_count)
		

if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
import os

def main():
	happy_count = 0
	money = int(input())
	str_money = str(money)
	happy_count = (money // 500) * 1000
	str_money = str_money[-2:]
	print((int(str_money)//5) * 5 + happy_count)
		

if __name__ == "__main__":
	main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

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

print(mod1*1000 + mod2*5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ure)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
coin = int(input())

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

print( happy1 + happy2 )

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#500-1000, 5-5

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

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
X = int(input("input:"))
uresisa_500yen = (X // 500) * 1000
mod = (X % 500)
uresisa_5yen = (mod // 5) * 5

uresisa_total = uresisa_500yen + uresisa_5yen
print(uresisa_total)

Submission status: Wrong Answer

Solution code:
# 計算
X = 1000000000
uresisa_500yen = (X // 500) * 1000
mod = (X % 500)
uresisa_5yen = (mod // 5) * 5

uresisa_total = uresisa_500yen + uresisa_5yen
print(uresisa_total)

Submission status: Wrong Answer

Solution code:
X = int(input("How much yen: "))
output = 0
if X >= 500:
    output += 500 * (X // 500)
    X = X - (500 % (X // 500))
output += 5 * (X // 5)

print(output)

Submission status: Wrong Answer

Solution code:
X = int(input("How much yen: "))
output = 0
if X >= 500:
    output += 500 * (X // 500)
    X = X - (X % (X // 500))
output += 5 * (X // 5)

print(output)

Submission status: Wrong Answer

Solution code:
X = int(input())
 
div = int(X/500)
mod = int(X%500)
hap = 0
 
if div != 0:
  hap = div*2
q = int(mod/5)
hap += q*5
 
print(hap)

Submission status: Wrong Answer

Solution code:
X = int(input())
 
div = int(X/500)
mod = int(X%500)
hap = 0
 
if div != 0:
  hap = div*2
q = int(mod/5)
hap += q
 
print(hap)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

yen500 = X // 500
nokori = X - yen500
yen5 = nokori // 5

print(yen500 * 1000 + yen5 * 5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x < 5:
  print(0)

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

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

print(HP)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X= int(input())

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

Submission status: Wrong Answer

Solution code:
yen = int(input())
count = 0

while yen - 500 > 0:
    yen -= 500
    count += 1000

while yen - 5 > 0:
    yen -= 5
    count += 5

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

line = input()
money = int(line)
happy = 0

calc_500 = math.floor(money / 500)

if calc_500 > 1:
  happy += calc_500 * 1000
  money -= calc_500 * 500
  calc_5 = math.floor(money / 5)
  
  if calc_5 > 1:
      happy += calc_5 * 5
      print(str(happy))
  else:
      print(str(happy))
else:
    calc_5 = math.floor(money / 5)
    if calc_5 > 1:
      happy += calc_5 * 5
      print(str(happy))
    else:
      print(str(happy))

Submission status: Wrong Answer

Solution code:
S = open(0).read().strip('\n')
q = int(S) // 500
mod = int(S) % 500 % 5
print(q*1000+mod*5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = int(input())
count1=-1
count2=-1
while s>=0:
 s=s-500
 count1=count1 +1
s=s+500
print(count1)
if s==0:
  yasashisa=count1*1000
  print(yasashisa)
else:
   while s >=0:
     s=s-5
     count2=count2 +1
   yasashisa=count1*1000+count2* 5
   print(yasashisa)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
en=int(input())

res = en/500*1000+(en%500)/5*5
print(res)

Submission status: Wrong Answer

Solution code:
en=int(input())

res=en/500+(en%500)/5

print(res)

Submission status: Wrong Answer

Solution code:
en=int(input())

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

print(a*1000+b*5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

b = x/500
c = b/5
d = b*1000
e = c * 5

print(d+e)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = input()
X = int(X)
if 0 <= X and X <= 10**9:
  a = X // 500
  b = a // 5
  print(a * 1000 + b * 5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
L=[500,100,50,10,5,1]
X=int(input())
happiness_points=0
for i in L:
  if X//i!=0:
    if i==500:
      happiness_points+=1000
    elif i==5:
      happiness_points+=5
    else:
      None

Submission status: Wrong Answer

Solution code:
X = int(input())
if 0 <= X <= 10**9:
  print((X - X % 500)*2 + ((X % 500)%5) * 5)

Submission status: Wrong Answer

Solution code:
def yen(word):
    h = 5
    y = ((word * h) / 500) * 100 
    #if (ar[2] == ar[3]) and (ar[4] == ar[5]):
     # return 'Yes'
    #else:
     # return 'No'
    return int(y)

if __name__ == '__main__':

    ar = int(input())

    result = yen(ar)
    print(result)

Submission status: Wrong Answer

Solution code:
def yen(word):
    h = 5
    y = ((word * h) / 500) * 100 
    #if (ar[2] == ar[3]) and (ar[4] == ar[5]):
     # return 'Yes'
    #else:
     # return 'No'
    return y

if __name__ == '__main__':

    ar = int(input())

    result = yen(ar)
    print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

if x%500 == 0:
  print(x*2)
else:
  ans = x//500 + (x//5)*5
  print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())
b=a//500
if b != 0:
      abc=b*1000
elif b == 0:
      abc = a
print(abc)

Submission status: Wrong Answer

Solution code:
b=int(input())
if b>=10:
      overall=b*2
      print(overall)
elif b<=9 and b>0:
      print(b)
elif b<=0:
      print(0)

Submission status: Wrong Answer

Solution code:
b=int(input())
if b>0:
      overall=b*2
      print(overall)
else:
      print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#　%%まず500円を持ちうる個数を確認する
X = int(input())
count1 = int(X/500) #500円の枚数
print(count1)

# %%　500円玉の合計額を引いた値から、5円玉を確認する
deducation = X - count1 * 500

count2 = int(deducation / 5)
print(count2)

# %%　スコアを計算する
uresisa = count1 * 1000 + count2 * 5
print(uresisa)

# %%

Submission status: Wrong Answer

Solution code:
x = int(input())

ans = 0

l500 = x // 500

x -= l500 * 500

l5 = x // 5

print(l500 * 1000 + l5)

Submission status: Wrong Answer

Solution code:
x = int(input())

ans = 0

l500 = x // 500

x -= l500 * 500

l5 = x // 5

print(l500 + l5)

Submission status: Wrong Answer

Solution code:
x = int(input())

ans = 0

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
end = False
if n / 500 >= 1:
    ans += n // 500 * 1000
    if n % 500 != 0:
        n = n % 500
    else:
        end = True
    if n / 5 >= 1 and not end:
        ans += n // 5 * 5
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
end = False
if n / 500 >= 1:
    ans += int(n / 500) * 1000
    if n % 500 != 0:
        n = n % 500
    else:
        end = True
    if n / 5 >= 1 and not end:
        ans += int(n / 5) * 5
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

S = n // 500
R = n - S
x = R // 5

H = 1000 * S + x * 5
print(H)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
money = int(input())

num_500 = int(money / 500)

remaining = int(money % 500)

num_5 = int(remaining / 5)

print('{}'.format(num_500 * 1000 + num_5 * 500 ))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
money = int(input())

happy = 0

happy += (money / 500) * 1000

money -= (money / 500) * 500

happy += (money / 5) * 5

print(happy)

Submission status: Wrong Answer

Solution code:
X = int(input())

count=(X//500)*1000
X=X//500
count+=(X//5)*5

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
sum = 0
for i in range(1000000):
  if 0<=n-500:
    n=n-500
    sum+=1000
  elif 0<n<500:
    if 0<n-5:
      sum+=5
      n=n-5
print(sum)

Submission status: Wrong Answer

Solution code:
X = int(input())

Y = X%500
Z = (X-Y*500)%5

print(1000*Y+5*Z)

Submission status: Wrong Answer

Solution code:
l = int(input())
print(l*2 if l%10==0 else (l-(l%10*6))*2 + (l%10*5))

Submission status: Wrong Answer

Solution code:
x = int(input())
point = 0
while x != 0:
    if x >= 100:
        result = x // 100
        summ = (100 * result)*2
        point = point + summ
        remainder = x % 100
        x = remainder
    if x >= 5:
        result = x // 5
        summ = 5 * result
        point = point + summ
        break;
print(point)

Submission status: Wrong Answer

Solution code:
x = int(input())
point = 0
while x != 0:
    if x >= 50:
        result = x // 50
        summ = (50 * result)*2
        point = point + summ
        remainder = x % 50
        x = remainder
    if x >= 5:
        result = x // 5
        summ = 5 * result
        point = point + summ
        break;
print(point)

Submission status: Wrong Answer

Solution code:
x = int(input())
point = 0
while x != 0:
    if x >= 50:
        result = x / 50
        summ = (50 * result)*2
        point = point + summ
        remain = x % 50
        x = remain
    if x >= 5:
        result = x / 5
        summ = 5 * result
        point = point + summ
        break;
print(point)

Submission status: Wrong Answer

Solution code:
x = int(input("enter "))
point = 0
while x != 0:
    if x >= 50:
        result = x / 50
        summ = (50 * result)*2
        point = point + summ
        remain = x % 50
        x = remain
    if x >= 5:
        result = x / 5
        summ = 5 * result
        point = point + summ
        break;
print(point)

Submission status: Wrong Answer

Solution code:
l = int(input())
if l>=1000:
    print(l*2)
elif l>=0 and l<1000:
    print(l)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

c_500 = x // 500
x = c_500 * 500
c_5 = x // 5

print(c_500 * 1000 + c_5 * 5)

Submission status: Wrong Answer

Solution code:
i=int(input())

print((i//500)*1000+(i-(i//500*500)//5*5))

Submission status: Wrong Answer

Solution code:
X = int(input())
ans =0 
while(1):
    print(X)
    if X < 5:
        break
    elif X<500:
        tmp = X // 5
        ans +=tmp*5
        X = X% 5
    else:
        tmp = X // 500
        ans +=tmp*1000
        X = X %500
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

A = X // 500
B = X % 5

print(A * 1000 + B * 5)

Submission status: Wrong Answer

Solution code:
S = int(input())

S500 = S/500

S_nokori = S-S500*500

S5 = S_nokori/5

print(1000*S500 + 5*S5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

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

print(a+b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(raw_input())

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

Submission status: Wrong Answer

Solution code:
x = int(raw_input())

y = x / 500
z = (x % 500) / 5

print(y + z)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    l = []
    
    if(n<0 or n>1000000000):
        main()
    
    
    if(n!=0):
        h1 = int(n/500)*1000
        ar = n - (int(n/500)*500)
        h1+=int(ar/5)*5
        h2 = int(n/5)*5
        print(ar)
        l.append(h1)
        l.append(h2)
        print(max(l))
    else:
        print(0)

main()

Submission status: Wrong Answer

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

if(X >= 500):
    n = X // 500;
    happy += n * 1000;
    m = X % 500;
    if(m >= 5):
        l = m // 5;
        happy += l * 5;
    
print(happy);

Submission status: Wrong Answer

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

if(X >= 500):
    n = X // 500;
    # print(n);
    happy += n * 1000;
    # print(happy);
    m = X % 500;
    if(m >= 5):
        l = m // 5;
        happy += l * 5;
    
print(happy);

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
while(True):
	if not n < 5:
		if n >= 1000:
			x = int(n / 1000)
			#print(x)
			count += (2000 * x)
			#print(count)
			n = n % 1000
			#print(n)
		else:
			z = int(n / 5)
			#print(z)
			count += (5 * z)
			#print(count)
			n = n % 5
			#print(n)
	else:
		break
print(int(count))

Submission status: Wrong Answer

Solution code:
n = int(input())

div_500, mod_500 = divmod(n,500)
if mod_500 > 0:
    div_5, mod = divmod(mod_500, 5)
    print(div_500*1000 + div_5*5)
else:
    print(div_500*100)

Submission status: Wrong Answer

Solution code:
c5, c2 = (500, 5)
yens = int(input())
happiness = 0
while yens >= 5:
    #print(yens)
    if yens > c5:
        happiness += 1000 * (yens // c5)
        yens %= c5
    elif yens >= c2:
        happiness += 5 * (yens // c2)
        yens %= c2 
        
print(happiness)

Submission status: Wrong Answer

Solution code:
x=int(input())

five_hundred=int(x/500)

five=int((x-five_hundred)/5)

print(five_hundred*1000+five*5)

Submission status: Wrong Answer

Solution code:
c5, c2 = (500, 5)
yens = int(input())
happiness = 0
while yens > 5:
    #print(yens)
    if yens > c5:
        happiness += 1000 * (yens // c5)
        #yens %= c5
        #print(yens)
        yens %= c5
    elif yens > c2 :
        happiness += 5 * (yens // c2)
        yens %= c2 
        
print(happiness)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
money = int(input())
# 500yen = 1000happy, 5yen = 1happy

n_500 = int(money//500)
n_5 = int((money - 500*n_500)//5)

happiness = 1000 * n_500 + n_5
print(happiness)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = int(input())
happy = 0
if s >= 500:
    happy += 1000 * (s // 500)
    s = s % 500
if s >= 5:
    happy += 5 * (s // 500)

print(happy)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

f = int(x / 500) * 1000

s = int((f % 500) / 5) * 5

print(f + s)

Submission status: Wrong Answer

Solution code:
x = int(input())
num = x / 500
w = x-(int(num)*500)
p = w / 5
sum = (int(num)*1000)+(int(p)*5)

Submission status: Wrong Answer

Solution code:
X = int(input())

coin1 = X / 500
coin2 = (X % 500) / 5

print(int(coin1*1000 + coin2*5))

Submission status: Wrong Answer

Solution code:
X = int(input())

coin1 = X / 500
coin2 = (X % 500) / 5

print(coin1*1000 + coin2*5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
money = int(input())
if money>500:
  val = money//500
  money=money-val
  val = val + money//5
  print(val)
else:
  val = money//5
  print(val)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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/500)*500
    if (int(str(ran)[-3:])>=500 and int(str(ran)[-3:])<600):
        print((ran*2)-int(str(ran)[-2:]))
    else:
        print((ran*2)-int(str(ran)[-3:]))

Submission status: Wrong Answer

Solution code:
X = int(input())
result = 0
while X > 5:
    if X > 500:
        result += int(X/500) * 1000
        X -= int(X/500) * 500
    elif X > 5:
        result += int(X/5) * 5
        X -= int(X/5) * 5

print(result)

Submission status: Wrong Answer

Solution code:
X = int(input())
result = 0
while X > 5:
    if X > 500:
        result += int(X/500) * 1000
        X -= int(X/500) * 500
    elif X > 5:
        result += int(X/5) * 5
        X -= int(X/5) * 5
print(result)

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
man = 1000 * C
t   = 5 * D

total = man + t

print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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