728x90
풀이
쇼핑을 할 때 1개를 살 때는 할인이 되지 않은 금액에 구매하지만,
2개 이상 부터는 추가 품목에 대해 2$씩 할인이 된다.
c - 1 개 만큼 2$씩 원가에서 뺀 가격을 입력값과 함께 출력해주자.
소스코드
출처
26332번: Buying in Bulk
The first input line contains a positive integer, n, indicating the number of customers to check. The customers are on the following n input lines, one customer per line. Each line provides two integers; the first integer c (1 ≤ c ≤ 100) is the number
www.acmicpc.net
728x90
'PS > Baekjoon Online Judge' 카테고리의 다른 글
[백준 26350] Good Coin Denomination [Python] (0) | 2023.09.02 |
---|---|
[백준 26340] Fold the Paper Nicely [Python] (0) | 2023.08.30 |
[백준 26068] 치킨댄스를 추는 곰곰이를 본 임스 2 [Python] (0) | 2023.08.29 |
[백준 25991] Lots of Liquid [Python] (0) | 2023.08.29 |
[백준 25932] Find the Twins [Python] (0) | 2023.08.29 |