time limit per test1 second

memory limit per test256 megabytes

inputstandard input

outputstandard output

Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction as a sum of three distinct positive fractions in form .

Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that . Because Chloe can’t check Vladik’s answer if the numbers are large, he asks you to print numbers not exceeding 109.

If there is no such answer, print -1.

Input

The single line contains single integer n (1 ≤ n ≤ 104).

Output

If the answer exists, print 3 distinct numbers x, y and z (1 ≤ x, y, z ≤ 109, x ≠ y, x ≠ z, y ≠ z). Otherwise print -1.

If there are multiple answers, print any of them.

Examples

input

3

output

2 7 42

input

7

output

7 8 56

【题目链接】:

【题解】



先让x=n

则转换成

1/n=1/y+1/z;

再做一下变化得到

z=n*y/(y-n)

可以看到

如果让y=n+1

那么z的分母为1

则z肯定是一个整数了

且x=n,y = n+1,z =n*(n+1)

当n大于1的时候x

#include <bits/stdc++.h>
using namespace std;
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define rep1(i,a,b) for (int i = a;i <= b;i++)
#define rep2(i,a,b) for (int i = a;i >= b;i--)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define rei(x) scanf("%d",&x)
#define rel(x) scanf("%I64d",&x) typedef pair<int,int> pii;
typedef pair<LL,LL> pll; //const int MAXN = x;
const int dx[9] = {0,1,-1,0,0,-1,-1,1,1};
const int dy[9] = {0,0,0,-1,1,-1,1,-1,1};
const double pi = acos(-1.0); LL n,a,b,c; int main()
{
//freopen("F:\\rush.txt","r",stdin);
rel(n);
if (n==1)
{
puts("-1");
}
else
{
a = n,b = n+1,c = n*n+n;
cout << a << " " << b << " " <<c<<endl;
}
return 0;
}

最新文章

  1. OpenStack云计算快速入门之二:OpenStack安装与配置
  2. 深入理解计算机系统(2.2)---布尔代数以及C语言上的位运算
  3. grub条目示例
  4. SqlSever基础 except 差集 前一个结果中不含有后一个结果的元素
  5. css3 keyframes animation
  6. ORACLE多表查询优化
  7. UIImageView的图片拉伸
  8. Linux下安装Oracle11g服务器(转)
  9. poj_2778_DNA Sequence(AC自动机+矩阵)
  10. React Native 之 数据持久化
  11. war包中少了class文件
  12. LCT模板(BZOJ2631)
  13. 如何查看cisco 生成树状态
  14. 剑指Offer——知识点储备-Java基础
  15. (4)top详解 (每周一个linux命令系列)
  16. hive vs hbase
  17. [洛谷P2066]机器分配
  18. 【转】《iOS7 by Tutorials》系列:iOS7的设计精髓(下)
  19. 1043 输出PATest
  20. Hbuilder用ajax连接阿里服务器上的servlet以及注意事项

热门文章

  1. spring之AOP(转)
  2. using the easy connect naming method 简单连接測试
  3. 使用MERGE语句同步表
  4. 【Cocos2d-x 017】 多分辨率适配全然解析
  5. Log4j日志管理的简单实例
  6. ZOJ 3674 Search in the Wiki(字典树 + map + vector)
  7. js17---创建对象:构造函数式和原型组合模式、动态原型模式、稳妥构造函数式
  8. Input File选择图片后,未保存预览
  9. C#与C++ DLL的交互
  10. 《ASP.NET》数据绑定—DropDownList、ListBox