Lucian_Adrian

#3807 SumeGaussDeSumeGauss

Sep 21st, 2021
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int i, n, x, a, b, c;
  6.  
  7. cin >> n;
  8. for (i = 1; i <= n; i++) {
  9. cin >> x;
  10.  
  11.  
  12. a = x, b = x + 1, c = x + 2;
  13. if (a % 2 == 0)
  14. a /= 2;
  15. else if (b % 2 == 0)
  16. b /= 2;
  17. else c /= 2;
  18. if (a % 3 == 0)
  19. a /= 3;
  20. else if (b % 3 == 0)
  21. b /= 3;
  22. else c /= 3;
  23. cout << 1ULL * a * b * c << ' ';
  24. }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment