Compy's Blog
48 words
1 minutes
[NYPC] 1차 1번 초밥
2024-11-06

pro

생각하면 풀리는 문제

for i in range(int(input())):
    a, b = map(int, input().split())

    if b < a//3+(1 if a % 3 else 0) or a < b//3+(1 if b % 3 else 0): print(-1)
    else: print((a+b)//4 + (1 if ((a+b)%4) else 0))
[NYPC] 1차 1번 초밥
https://compy07.github.io/Blog/posts/algorithms/nypc/2024/first/1/
Author
뒹굴뒹굴 이정훈 공부방
Published at
2024-11-06