시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 32 MB80093653281749.171%

문제

어떠한 자연수 N은, 몇 개의 연속된 자연수의 합으로 나타낼 수 있다. 당신은 어떤 자연수 N(1 ≤ N ≤ 10,000,000)에 대해서, 이 N을 몇 개의 연속된 자연수의 합으로 나타내는 가지수를 알고 싶어한다. 이때, 사용하는 자연수는 N이하여야 한다.

예를 들어, 15를 나타내는 방법은 15, 7+8, 4+5+6, 1+2+3+4+5의 4가지가 있다. 반면에 10을 나타내는 방법은 10, 1+2+3+4의 2가지가 있다.

N을 입력받아 가지수를 출력하는 프로그램을 작성하시오.

입력

첫 줄에 정수 N이 주어진다.

출력

입력된 자연수 N을 몇 개의 연속된 자연수의 합으로 나타내는 가지수를 출력하시오

예제 입력 1

15

예제 출력 1

4
W3sicHJvYmxlbV9pZCI6IjIwMTgiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMyMThcdWI0ZTRcdWM3NTggXHVkNTY5IDUiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YzViNFx1YjVhMFx1ZDU1YyBcdWM3OTBcdWM1ZjBcdWMyMTggTlx1Yzc0MCwgXHViYTg3IFx1YWMxY1x1Yzc1OCBcdWM1ZjBcdWMxOGRcdWI0MWMgXHVjNzkwXHVjNWYwXHVjMjE4XHVjNzU4IFx1ZDU2OVx1YzczY1x1Yjg1YyBcdWIwOThcdWQwYzBcdWIwYmMgXHVjMjE4IFx1Yzc4OFx1YjJlNC4gXHViMmY5XHVjMmUwXHVjNzQwIFx1YzViNFx1YjVhNCBcdWM3OTBcdWM1ZjBcdWMyMTggTigxICZsZTsgTiAmbGU7IDEwLDAwMCwwMDApXHVjNWQwIFx1YjMwMFx1ZDU3NFx1YzExYywgXHVjNzc0IE5cdWM3NDQgXHViYTg3IFx1YWMxY1x1Yzc1OCBcdWM1ZjBcdWMxOGRcdWI0MWMgXHVjNzkwXHVjNWYwXHVjMjE4XHVjNzU4IFx1ZDU2OVx1YzczY1x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-2003 Season > USACO March 2003 Contest > Orange 2번

  • 데이터를 추가한 사람: momiens
  • 문제의 오타를 찾은 사람: yukariko