Problem:
Please find the problem here.
Solution:
This is the simplest problem I ever had, just implement the given formulas! However, it does take me some time to write.
Code:
Please find the problem here.
Solution:
This is the simplest problem I ever had, just implement the given formulas! However, it does take me some time to write.
Code:
using namespace std;
int main(){
int n,sum;
cin>> n;
for(int i=n/2;i>=1;i--){
if(__gcd(i,n-i)== 1){
cout<<i<< " "<<n-i<<endl;
return 0;
}
}
}
No comments:
Post a Comment