AT_abc439_c [ABC439C] 2026

Description

A positive integer $ n $ is called a **good integer** when it satisfies the following condition: - There exists exactly one pair of integers $ (x,y) $ that satisfies $ 0 \lt x \lt y $ and $ x^2+y^2=n $ . For example, when $ n=2026 $ , it can be verified that $ (x,y)=(1,45) $ is the only pair of integers that satisfies $ 0 \lt x \lt y $ and $ x^2+y^2=n $ . Thus, $ 2026 $ is a good integer. You are given a positive integer $ N $ . Enumerate all good integers not exceeding $ N $ .

Input Format

The input is given from Standard Input in the following format: > $ N $

Output Format

Let there be $ k $ good integers not exceeding $ N $ , and let $ (a_1, a_2, \dots, a_k) $ be the sequence of these integers in ascending order. Output the answer in the following format. (If $ k=0 $ , output the second line as an empty line.) > $ k $ $ a_1 $ $ a_2 $ $ \dots $ $ a_k $

Explanation/Hint

### Sample Explanation 1 $ (x,y)=(1,2) $ is the only pair of integers that satisfies $ 0 \lt x \lt y $ and $ x^2+y^2=5 $ , so $ 5 $ is a good integer. $ (x,y)=(1,3) $ is the only pair of integers that satisfies $ 0 \lt x \lt y $ and $ x^2+y^2=10 $ , so $ 10 $ is a good integer. These are the only two good integers not exceeding $ N $ . ### Constraints - $ 1 \leq N \leq 10^7 $ - $ N $ is an integer.