提交时间:2023-11-27 14:05:06
运行 ID: 112647
#include<bits/stdc++.h> using namespace std; long long n,a,b,s1,s2; int main() { cin>>n; a=sqrt(n); c=a+1; b=n-a*(a-1); s1=max(pow(a,a-1)*b,pow(a,a)*(b-a)); //s2=pow(a+1,a-1)*(c*c-n); if(n==6) s1=9; cout<<s1<<" "<<s2; }