본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 12250번 New Lottery Game (Small)

by 현장 2024. 3. 2.

-Code

for t in range(int(input())):
    a, b, k = map(int, input().split())
    res = 0

    for i in range(a):
        for j in range(b):
            if i & j < k:
                res += 1

    print(f"Case #{t + 1}: {res}")