-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef99fe7
commit 06f49c9
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import math | ||
|
||
n = int(input()) | ||
for i in range(n): | ||
cnt = 0 | ||
k = int(input()) | ||
j = 2 # 적어도 2개 이상의 연속된 자연수의 합 | ||
while True: | ||
center_first = math.floor(k / j) # center 값을 초기화 | ||
div = j // 2 | ||
if center_first < div: | ||
break | ||
if j % 2 == 0: | ||
if ((center_first + center_first + 1) * div == k): | ||
cnt += 1 | ||
elif j % 2 == 1: | ||
if ((center_first * 2 * div + center_first) == k): | ||
cnt += 1 | ||
j += 1 | ||
print(cnt) |