我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

A Simple Problem

Problem Description
For a given positive integer n, please find the smallest positive integer x that we can find an integer y such that y^2 = n +x^2.

Input
The first line is an integer T, which is the the number of cases.
Then T line followed each containing an integer n (1<=n <= 10^9).

Output
For each integer n, please print output the x in a single line, if x does not exit , print -1 instead.

Sample Input
2
2
3

Sample Output
-1
1

近期文章

  • Bacon's Cipher 密码问题
  • KFC -Z+W 怎么做的
  • Cover The Enemy 具体的编写
  • Magic Potion 代码的思想
  • Length of S(n) 求和的问题
  • The Game of 31 游戏的算法
  • Alaska 的程序的问题
  • 用C 语言来求奇数的乘积
  • Grey Area 代码实现
  • TURBO C语言开发最佳的电脑CUP的选择是什么,请问志强E52640V2是否可以支持
  • 请问Windows 10下兼容的C语言的开发环境,方便使用的有哪些推荐的
  • Shoring Up the Levees 程序写法
  • Combination Lock 代码的编写
  • pix2pix运行后各参数的含义及变化
  • unity的game界面里有canvas的线框?如何隐藏掉?
  • Qt输入框密码样式设置为*不成功,有人知道原因?
  • Druid连接Mysql出现错误,create connection SQLException
  • maven的pom文件中配置的tomcat和edit Configurations里配置的tomcat有何区别,或者说那个好?
  • 求助!Maven创建不了工程,出现一下问题,重装Maven也不行
  • vs2010 mfc ADO连接SQL server 程序不解

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华