题意:给定 n 值,输出符合的 x, y, z 。
思路:
即 x = n, y = n+1, z = n*(n+1)
ac code:
#include<stdio.h>
#include<cstring>
#include<cmath>
#include<algorithm>
#define HardBoy main()
#define ForMyLove return 0;
using namespace std;
const int MYDD = 1103;
int HardBoy {
int n;
scanf("%d", &n);
if(n == 1){
puts("-1");
} else {
printf("%d %d %d\n", n, n+1, n*(n+1));
}
ForMyLove
}

本文介绍了一个关于将特定形式的分数拆分为三个不同正分数之和的问题,并提供了一种有效的解决方案。通过设定特定的x、y、z值,能够满足题目要求的条件,即对于任意正整数n,找到x、y、z使得分数1/n可以表示为它们的和。
as a sum of three distinct positive fractions in form
.
. Because Chloe can't check Vladik's answer if the numbers are large, he asks you to print numbers not exceeding
400

被折叠的 条评论
为什么被折叠?



