Agorithm/백준 알고리즘

백준 알고리즘 16561번 3의 배수(python)

kimjinho1 2021. 2. 28. 00:34
728x90
반응형

단순 수학 문제이다.

n = int(input())
cnt = 0
for i in range(3, max(n-6, 0)+1, 3):
    for j in range(i+3, max(n-3, 0)+1, 3):
        cnt += 1
print(cnt)
728x90
반응형