#include<stdio.h>
int main()
{
long long t,n;
while(~scanf("%lld",&n))
{
if(n==1)
t=1;
else if(n==2)
t=2;
else if(n%2)
t=n*(n-1)*(n-2);
else
{
if(n%3)
t=(n-1)*(n-2)*(n-3);
else
t=n*(n-1)*(n-3);
}
printf("%lld\n",t);
}
}
转载于:https://www.cnblogs.com/mycapple-zgs-111411/p/4619459.html