반응형
백준: 21633번 Bank Transfer (Python3)
Bank Transfer 성공스페셜 저지다국어
시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 | 512 MB | 719 | 530 | 485 | 74.501% |
문제
Tanya has an account in "Redgotts" bank. The bank has the commission to transfer money to "Bluegotts" bank that her friend Vanya has the account in.
Tanya has read her bank rules and learned the following:
The commission for the bank transfer is 25 tugriks plus 1% of the sum transferred. However, the commission is never smaller than 100 tugriks, and cannot exceed 2000 tugriks.
Tanya is planning to transfer k tugriks to Vanya. Help her find out what the commission would be.
입력
Input is a single integer k (200≤k≤109 ).
출력
Output one floating point value: the commission for the transfer. The value must be printed with at least two exact digits after the decimal point.
예제 입력 1
20210
예제 출력 1
227.10
예제 입력 2
9000
예제 출력 2
115.00
예제 입력 3
300000
예제 출력 3
2000.00
답안
1
2
3
4
5
6
7
8
|
amount = int(input())
if (amount*0.01 + 25) < 100:
print(100)
elif (amount*0.01 + 25) > 2000:
print(2000)
else:
print(amount*0.01+25)
|
cs |
반응형
'공부 > 코딩테스트' 카테고리의 다른 글
백준: 21612번 Boiling Water (Python3) (0) | 2022.08.09 |
---|---|
백준: 21631번 Checkers (Python3) (0) | 2022.08.09 |
백준: 21638번 SMS from MCHS (Python3) (0) | 2022.08.09 |
백준: 21665번 Миша и негатив (Python3) (2) | 2022.08.09 |
백준: 22015번 金平糖 (Konpeito) (Python3) (0) | 2022.08.09 |
댓글