https://www.acmicpc.net/problem/26340
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
def sol(num1, num2, cnt):
for _ in range(cnt):
if num1>num2:
num1 = int(num1/2)
else:
num2 = int(num2 / 2)
return max(num1,num2),min(num1,num2)
if __name__ == '__main__':
n = int(input())
for _ in range(n):
num1, num2, cnt = map(int, input().split())
print('Data set: %d %d %d'%(num1,num2,cnt))
print(*sol(num1, num2, cnt))
if _ !=n-1:
print()
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
백준 26531 Simple Sum (0) | 2022.12.22 |
---|---|
백준 6825 Body Mass Index (0) | 2022.12.22 |
백준 6887 Squares (0) | 2022.12.22 |
백준 5357 Dedupe (0) | 2022.12.22 |
백준 26350 Good Coin Denomination (0) | 2022.12.22 |
댓글