CF743C Vladik and fractions

CF743C Vladik and fractions

构造

公共解是 n n+1 n(n+1)

原因:

1/n+1/n+1+1/n(n+1)=2n+1+1/n(n+1)=2/n

但是注意,n=1的时候无解

其中x,y,zx,y,z为正整数并且互不相同

代码:

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll x;
int main(){
    cin>>x;
    if(x==1){
        printf("-1\n");
        return 0;
    }
    cout<<x<<" "<<x+1ll<<" "<<x*(x+1ll)<<endl;
    return 0;
} 

 

posted @ 2019-10-04 20:09  QYJ060604  阅读(100)  评论(0编辑  收藏  举报