fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main() {
  6. long n;
  7. cin >> n;
  8.  
  9. if (n == 1) {
  10. cout << 1;
  11. } else if (n == 2) {
  12. cout << 2;
  13. } else {
  14. cout << n * (n - 1) * (n - 2);
  15. }
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 5280KB
stdin
20
stdout
6840