Triangular numbers

TimeLimit:2000MS  MemoryLimit:256MB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description

A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-th triangular number is the number of dots in a triangle with n dots on a side. . You can learn more about these numbers from Wikipedia (http://en.wikipedia.org/wiki/Triangular_number).

Your task is to find out if a given integer is a triangular number.


Input

The first line contains the single number n (1 ≤ n ≤ 500) — the given integer.

Output

If the given integer is a triangular number output YES, otherwise output NO.

SampleInput 1
1
SampleOutput 1
YES
SampleInput 2
2
SampleOutput 2
NO
SampleInput 3
3
SampleOutput 3
YES
Submit
题目统计信息详细
总AC数23
通过人数23
尝试人数25
总提交量28
AC率82.14%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: