시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
5 초 128 MB 183 33 15 14.151%

문제

연속하는 p(p > 0)개의 정수의 합이 바로 다음에 연속하는 q개의 양의 정수의 합과 일치하는 경우가 있다.

예를 들어, 9+10+11+12 = 13+14+15이고, (p=4, q=3) 4+5+6+7+8 = 9+10+11이다. (p=5, q=3)

q가 주어졌을 때, 가능한 p의 개수를 구하는 프로그램을 작성하시오.

입력

입력은 테스트 케이스 여러 개로 이루어져 있다. 각 테스트 케이스는 한 줄로 이루어져 있으며, q값이 주어진다. q는 1014보다 작은 양의 정수이다.

입력의 마지막 줄에는 0이 하나 주어지고, 입력의 개수는 2,000개를 넘지 않는다.

출력

각 테스트 케이스에 대해서, 가능한 p값의 수를 출력한다.

예제 입력 1

5
1
0

예제 출력 1

6
2
W3sicHJvYmxlbV9pZCI6IjU2NDciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM1ZjBcdWMxOGQgXHVkNTY5IiwiZGVzY3JpcHRpb24iOiI8cD5cdWM1ZjBcdWMxOGRcdWQ1NThcdWIyOTQgcChwICZndDsgMClcdWFjMWNcdWM3NTggXHVjODE1XHVjMjE4XHVjNzU4IFx1ZDU2OVx1Yzc3NCBcdWJjMTRcdWI4NWMgXHViMmU0XHVjNzRjXHVjNWQwIFx1YzVmMFx1YzE4ZFx1ZDU1OFx1YjI5NCBxXHVhYzFjXHVjNzU4IFx1YzU5MVx1Yzc1OCBcdWM4MTVcdWMyMThcdWM3NTggXHVkNTY5XHVhY2ZjIFx1Yzc3Y1x1Y2U1OFx1ZDU1OFx1YjI5NCBcdWFjYmRcdWM2YjBcdWFjMDAgXHVjNzg4XHViMmU0LjxcL3A+XHJcblxyXG48cD5cdWM2MDhcdWI5N2MgXHViNGU0XHVjNWI0LCA5KzEwKzExKzEyID0gMTMrMTQrMTVcdWM3NzRcdWFjZTAsIChwPTQsIHE9MykgNCs1KzYrNys4ID0gOSsxMCsxMVx1Yzc3NFx1YjJlNC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