SPOJ TWOSQRS

From Algorithmist
Jump to navigation Jump to search

Problem Number - Problem Name[edit]

Summary[edit]

Given integer n decide if it is possible to represent it as a sum of two squares of integers.

Input[edit]

10
1
2
7
14
49
9
17
76
2888
27

Output[edit]

Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
No

External Links[edit]

  • Two Squares - Determine if a number is the sum of two squares.
  • Fermat's Theorem on sums of two squares - Wiki Link