728x90
풀이
가로와 세로, 접는 횟수를 입력받아 가장 긴 변을 반으로 접는 문제다.
단, 가장 긴 변을 접고도 가장 긴 변이라면 한번 더 접어야 한다는 사실에 유의하자.
출력시 긴 변의 길이를 먼저 출력해줘야 한다.
소스코드
출처
26340번: Fold the Paper Nicely
Dr. Orooji has a daily calendar (365 pages) on his desk. Every morning, he tears off one page and, as he is reading the notes on the next page, he folds (out of habit) the sheet in his hand. Dr. O noticed that he always folds the sheet (a rectangular paper
www.acmicpc.net
728x90
'PS > Baekjoon Online Judge' 카테고리의 다른 글
[백준 28282] 운명 [Python] (1) | 2023.09.05 |
---|---|
[백준 26350] Good Coin Denomination [Python] (0) | 2023.09.02 |
[백준 26332] Buying in Bulk [Python] (0) | 2023.08.29 |
[백준 26068] 치킨댄스를 추는 곰곰이를 본 임스 2 [Python] (0) | 2023.08.29 |
[백준 25991] Lots of Liquid [Python] (0) | 2023.08.29 |