시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 36 20 15 62.500%

문제

R은 변의 길이가 정수인 직사각형이다. 직사각형은 단위 정사각형으로 나눌 수 있다.

f(R)은 직사각형의 한 대각선이 지나는 정사각형의 개수라고 정의한다. 변의 길이가 2와 4인 직사각형 R의 f(R) = 4이다.

N이 주어졌을 때, f(R) = N을 만족하는 직사각형의 개수를 구하는 프로그램을 작성하시오. 변의 길이가 a×b인 직사각형과 b×a인 직사각형은 같은 직사각형이다. 

입력

첫째 줄에 자연수 N (0 < N < 106)이 주어진다. 

출력

첫째 줄에 f(R) = N인 R의 개수를 출력한다.

예제 입력 1

4

예제 출력 1

4

힌트

W3sicHJvYmxlbV9pZCI6IjM2MTQiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM4MTVcdWMwYWNcdWFjMDFcdWQ2MTUiLCJkZXNjcmlwdGlvbiI6IjxwPlJcdWM3NDAgXHViY2MwXHVjNzU4IFx1YWUzOFx1Yzc3NFx1YWMwMCBcdWM4MTVcdWMyMThcdWM3NzggXHVjOWMxXHVjMGFjXHVhYzAxXHVkNjE1XHVjNzc0XHViMmU0LiBcdWM5YzFcdWMwYWNcdWFjMDFcdWQ2MTVcdWM3NDAgXHViMmU4XHVjNzA0IFx1YzgxNVx1YzBhY1x1YWMwMVx1ZDYxNVx1YzczY1x1Yjg1YyBcdWIwOThcdWIyMGMgXHVjMjE4IFx1Yzc4OFx1YjJlNC48XC9wPlxyXG5cclxuPHA+ZihSKVx1Yzc0MCBcdWM5YzFcdWMwYWNcdWFjMDFcdWQ2MTVcdWM3NTggXHVkNTVjIFx1YjMwMFx1YWMwMVx1YzEyMFx1Yzc3NCBcdWM5YzBcdWIwOThcdWIyOTQgXHVjODE1XHVjMGFjXHVhYzAxXHVkNjE1XHVjNzU4IFx1YWMxY1x1YzIxOFx1Yjc3Y1x1YWNlMCBcdWM4MTVcdWM3NThcdWQ1NWNcdWIyZTQuIFx1YmNjMFx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