PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#BS0000084. Kiểm tra số chính phương (Valid Perfect Square)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Kiểm tra số chính phương (Valid Perfect Square)

Valid Perfect Square

Source: LeetCode

Version: Phuoc Hung OJ Extended

Problem Statement

A positive integer is a perfect square if it is the square of an integer. Determine whether a given positive integer xx is a perfect square, without built-in square-root functions.

Input

A single line contains xx.

Output

Print true if some integer rr satisfies r2=xr^2=x, otherwise false.

Subtasks

  • Subtask 1 (20 points): 1≤x≤10001\le x\le 1000.
  • Subtask 2 (30 points): 1≤x≤10000001\le x\le 1000000.
  • Subtask 3 (50 points): 1≤x≤21474836471\le x\le 2147483647.

Examples

Input

16

Output

true

Explanation

For x=16x=16, the integer 44 satisfies 42=164^2=16, so print true.