fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. const int Mod=998244353;
  5.  
  6. void solve() {
  7. ll n;
  8. cin >> n;
  9. if(n%2==1){
  10. cout << n*(n-1)*(n-2);
  11. return;
  12. }
  13. if(n%3==0){
  14. cout << (n-1)*(n-2)*(n-3);
  15. return;
  16. }
  17. cout << n*(n-1)*(n-3);
  18. }
  19.  
  20. int main(){
  21. ios::sync_with_stdio(false);
  22. cin.tie(nullptr);
  23.  
  24. /*int t;
  25.   cin >> t;
  26.   while (t--)*/ solve();
  27.  
  28.  
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0.01s 5240KB
stdin
7

stdout
210