【Codeforces 743C Vladik and fractions】
来源:互联网 发布:明星淘宝店铺大全 编辑:程序博客网 时间:2024/04/30 17:18
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 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
水题~有史以来的最水的C题~比A题还水~
AC代码:
#include<cstdio>int main(){ int N; scanf("%d",&N); if(N == 1) printf("-1\n"); else printf("%d %d %d\n",N,N + 1,N * (N + 1)); return 0;}
- 【44.64%】【codeforces 743C】Vladik and fractions
- codeforces 743 C. Vladik and fractions(构造)
- 743C. Vladik and fractions codeforces
- CodeForces-743C Vladik and fractions(构造)
- 【Codeforces 743C Vladik and fractions】
- codeforces 743 C. Vladik and fractions (数学)
- Codeforces 743C-Vladik and fractions(构造)
- Codeforces 743C Vladik and fractions(数学)
- codeforces 743-C. Vladik and fractions(构造)
- Codeforces Round #384 (Div. 2) 743C Vladik and fractions
- 数学题(Vladik and fractions,743C)
- Codeforces Round #384(Div. 2)C. Vladik and fractions【数学】
- Codeforces Round #384 (Div. 2) C Vladik and fractions
- Codeforces Round #384 (Div. 2)-C. Vladik and fractions
- Codeforces Round #384 (Div. 2) C. Vladik and fractions
- Codeforces Round #384 (Div. 2) C. Vladik and fractions
- codeforce 743 C. Vladik and fractions (数学构造)
- codeforces #384 Vladik and fractions (构造算法)
- 春哥nginx
- SSL JudgeOnline 1198——求逆序对数
- 理解Android JNI
- 第十六周项目4--英文单词的基数排序
- JQuery中$.ajax()方法参数详解
- 【Codeforces 743C Vladik and fractions】
- java冒泡排序、基本类型、运算符
- 寒假前計劃
- SSL 2521 数数
- Windows下VS2015编译caffe
- return和exit()
- Java读取maven resource下文件
- python 实现 softmax分类器(MNIST数据集)
- Mac 10.12版本 ,在安全选项里面上显示 任何来源