Discription
Here is a farm. Here is a farmer that counts how many animal live in his farm: a camels, b sheep, c green cockroaches. Occurs that a n + b n = c n. n is given. You are to find all the rest.

Input

n (0 ≤ n ≤ 100)

Output

Three different integers (a, b and c) such that a n + b n = c n, 1 ≤ a, b, c ≤ 100. If there are several solutions you should output the one where a is minimal. If there are several solutions with the minimal a you should output the one with minimal b, and so on. Output −1 if there is no solution.

Example

input output
0
-1
1
1 2 3

以前一直吐槽费马大定理实在是废,结果今天终于碰着了hhhhh。

这个定理贼简单,大致就是对于n>=3,不存在整数a,b,c使得a^n+b^n=c^n。

然后这就是个水题了hhhhh

(我直接在提交界面写的代码都没编译hhhhh)

#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cmath>
using namespace std;
int n;
int main(){
scanf("%d",&n);
if(!n||n>) puts("-1");
else{
if(n==) puts("1 2 3");
else puts("3 4 5");
}
return ;
}

最新文章

  1. EF继承关系映射
  2. ***Linux文件夹文件创建、删除、改名
  3. 初始Python类
  4. loadView在App启动时到底都干了些什么?
  5. thrift总结
  6. “LC.exe已退出,代码为-1错误”解决办法
  7. A Mathematician‘s Survival Guide Graduate School and Early Career Development
  8. UVaLive6039 Uva1668 Let&#39;s Go Green
  9. Ubuntu系统安装stardict(星际译王)词典
  10. Linux/ubuntu下的boost库安装
  11. 使用Google Roads API抓取道路信息(java实现)
  12. javascript 控制台输出 图片 console.log 真强大 真佩服你们的创造力
  13. 爬取知名社区技术文章_items_2
  14. Matlab中数据的存储方式
  15. Android高效率编码-findViewById()的蜕变-注解,泛型,反射
  16. Mysql:数据库导入导出
  17. jmeter5.0之源码导入 IntelliJ IDEA
  18. 深入理解Git - 一切皆commit
  19. ZH奶酪:利用CSS将checkbox选项放大
  20. 较常用的Math方法及ES6中的扩展

热门文章

  1. ubuntu安装GraphicsMagick
  2. 转载:Java中的String与常量池
  3. eclipse配置文件内存设置
  4. 【bzoj1911-[Apio2010]特别行动队】斜率优化
  5. swift mac 使用git, 并使用osc, 打开当前目录命令在终端输入 open . windows 下为start .
  6. Codeforces Round #433
  7. mac air上archlinux的安装及优化
  8. 使用Github官方提供的gitignore过滤Git提交的文件
  9. 获取mac地址和IP地址方式
  10. 分析函数调用堆栈的原理和Delphi实现