창 사이즈를 줄이면 아냐 포저의 귀여운 얼굴을 더 잘 볼 수 있습니다.

<aside> 💡 1. 거스름돈 반환 2. 분해합 3. 피보나치 수열 4. 요세푸스 문제 5. 랜선 자르기

"NeW nOtE"

</aside>

1. 거스름돈 반환

1. 초기 스케치

Untitled

2. 구현

import sys
input = sys.stdin.readline

five : int
two : int
money : int

money=int(input())

if money ==1 or money==3 :
    print("-1")
    exit()
elif (money % 5)%2 == 0  :
    five = money / 5
    money = money % 5
    two = money /2
elif (money % 5)%2 != 0 and (money % 5)%2 > 0 :
    five = money / 5
    while(True) :
        if (money - int(five)*5)%2 == 0 :
            break;
        else :
            five -=1
    money=money-int(five)*5
    two=money/2

print(int(five+two))

3. 추가

2. 분해합

1. 코드