C. Vladik and fractions
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard 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 xy 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 xy and z (1 ≤ x, y, z ≤ 109, x ≠ yx ≠ zy ≠ z). Otherwise print -1.

If there are multiple answers, print any of them.

思路:2/n=1/n+1/n=1/n+1/(n+1)+1/(n+1)*n  当n=1 时显然不符合条件。

代码:

 #include "cstdio"
 #include "iostream"
 int n,m;
 int main()
 {
     scanf("%d",&n);
     ) puts("-1");
     ,n*(n+));
     ;

 }

Codeforces Round #384 (Div. 2).C的更多相关文章

  1. Codeforces Round #384 (Div. 2) E. Vladik and cards 状压dp

    E. Vladik and cards 题目链接 http://codeforces.com/contest/743/problem/E 题面 Vladik was bored on his way ...

  2. Codeforces Round #384 (Div. 2)D - Chloe and pleasant prizes 树形dp

    D - Chloe and pleasant prizes 链接 http://codeforces.com/contest/743/problem/D 题面 Generous sponsors of ...

  3. Codeforces Round #384 (Div. 2) C. Vladik and fractions 构造题

    C. Vladik and fractions 题目链接 http://codeforces.com/contest/743/problem/C 题面 Vladik and Chloe decided ...

  4. Codeforces Round #384 (Div. 2)B. Chloe and the sequence 数学

    B. Chloe and the sequence 题目链接 http://codeforces.com/contest/743/problem/B 题面 Chloe, the same as Vla ...

  5. Codeforces Round #384 (Div. 2) A. Vladik and flights 水题

    A. Vladik and flights 题目链接 http://codeforces.com/contest/743/problem/A 题面 Vladik is a competitive pr ...

  6. Codeforces Round #384(div 2)

    A 题意:有n个机场处于一直线上,可两两到达,每个机场只可能属于两家公司中的一家(用0,1表示),现在要从a机场到b机场,可任意次转机.若机场i与机场j从属同一公司,则费用为0,否则费用为1.问最小费 ...

  7. Codeforces Round #384 (Div. 2) C. Vladik and fractions(构造题)

    传送门 Description Vladik and Chloe decided to determine who of them is better at math. Vladik claimed ...

  8. Codeforces Round #384 (Div. 2) B. Chloe and the sequence(规律题)

    传送门 Description Chloe, the same as Vladik, is a competitive programmer. She didn't have any problems ...

  9. Codeforces Round #384 (Div. 2) 734E Vladik and cards

    E. Vladik and cards time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  10. Codeforces Round #384 (Div. 2)D-Chloe and pleasant prizes

    D. Chloe and pleasant prizes time limit per test 2 seconds memory limit per test 256 megabytes input ...

随机推荐

  1. PHP学习1 — PHP文件处理

    PHP 中 include 与 require  Php include (或 require)语句会获取指定文件中存在的所有文本/代码/标记,并复制到使用 include 语句的文件中. 这意味着您 ...

  2. Laravel Migrate

    artisan命令行创建migrate 格式: php artisan make:migration YourFileName 示例: php artisan make:migration creat ...

  3. SVN 中trunk、branches、tags的详解

    1.trunk是主分支,是日常开发进行的地方.2.branches是分支.一些阶段性的release版本,这些版本是可以继续进行开发和维护的,则放在branches目录中.又比如为不同用户客制化的版本 ...

  4. HTML 5入门知识(五)

    本地存储Web Storage 使用HTML 5的Web Storage功能,可以在客户端存储更多的数据,而且可以实现数据在多个页面中共享甚至是同步. cookie存储数据的不足 cookie可用于在 ...

  5. Jmeter+Badboy实战经验三 Jmeter关联相关知识

    1. 什么时候需要使用关联? 有些参数是动态变化的,获取之后,再次操作的时候,参数的值已经发生了变化,这种情况下就会出现脚本不可运行的问题,就需要用到了关联 2. 关联是什么概念? 3.jmeter ...

  6. vue入门 vue与react和Angular的关系和区别

    一.为什么学习vue.js vue.js兼具angular.js和react的优点,并且剔除了他们的缺点 官网:http://cn.vuejs.org/ 手册:http://cn.vuejs.org/ ...

  7. 1774: [Usaco2009 Dec]Toll 过路费

    1774: [Usaco2009 Dec]Toll 过路费 Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 263  Solved: 154[Submit ...

  8. PHP无锁内存nosql---Yac的实战

    无锁内存nosql---Yac的实战 最近在工作使用了yac,所以比较了下Memcache和Yac的高并发读写性能测试,发现Yac要比Memcache快很多(这里没有比较Yac和Apc的性能情况, 不 ...

  9. Jmeter正则提取器常用的几种方式

    使用jmeter的同学都知道,jmeter提供了各种各样的提取器,如jsonpath.Beanshell.Xpath.正则等!!! 我们就针对正则提取器如何使用进行说明. 举例说明:假设取sessio ...

  10. [.net 面向对象程序设计深入](26)实战设计模式——使用Ioc模式(控制反转或依赖注入)实现松散耦合设计(1)

    [.net 面向对象程序设计深入](26)实战设计模式——使用IoC模式(控制反转或依赖注入)实现松散耦合设计(1) 1,关于IOC模式 先看一些名词含义: IOC: Inversion of con ...